├── marketing ├── logo.md ├── content.md ├── launch.md ├── brand_identity.md ├── positioning.md ├── 01_summary.md └── influencer.md ├── powershell ├── Message_of_the_day.md ├── elevate.md ├── Random.md ├── Use_Google_Maps.md ├── diff_between_two_dates.md ├── Run_Runas_Administrator.jpg ├── download_webpage_to_file.md ├── multi-line_comments.md ├── see_function_definition.md ├── tree.md ├── parts_of_a_fileSystemInfo_object.md ├── max_of_two_values.md ├── sleep_milliseconds.md ├── Width_of_the_Console.md ├── here_strings.md ├── repeat_every_n_seconds_forever ├── find_all_fonts.md ├── date_format.md ├── find_headings_in_markdown ├── call_commandline_apps.md ├── find_headings_in_markdown.md ├── format_table_with_expressions.md ├── how_to_find_free_space_on_C_drive.md ├── is_current_user_admin.md ├── module_what_is_it.md ├── interactive_remote_script.md ├── sort.md ├── rename_with_force.md ├── count_repositories.md ├── runas.md ├── convert_KB_MB_GB.md ├── boot_time.md ├── version.md ├── get_aduser.md ├── custom_objects.md ├── create_profile.md ├── Test_Path.md ├── who_is_using_each_port.md ├── replace_a_line_in_a_file.md ├── find_text.md ├── top_ten_files.md ├── operation_is_blocked_by_software_restriction_policies.md ├── is_this_64_or_32_bit_powershell_today.md └── count_distinct_rows.md ├── cover.jpg ├── cover.pdn ├── npm ├── amd.md ├── NPMTabRun2.gif ├── List_Globally_Installed_npm_Packages.md ├── nodejs_on_ubuntu_linux.md ├── node_gyp_dependencies.md ├── 01_summary.md └── install_npm.md ├── .bookignore ├── yfp_book.png ├── google635fcc2a99165998.html ├── linux ├── apt_get.md ├── what_my_ip_address.md ├── rename_files_with_mv.md ├── mkdir_recursive_force.md ├── nano.md ├── version.md ├── delete_files_older_than_90_days.md ├── xlsx_to_csv.md └── count_files_recursively.md ├── angular ├── welcome.png └── 01_summary.md ├── music ├── quadrants.pdn ├── quadrants.png ├── dorian_aeolian_phrygian.png ├── majorheptatonicpositions.png ├── majorpentatonicpositions.gif ├── majorpentatonicpositions.png ├── minorheptatonicpositions.png ├── minorpentatonicpositions.gif ├── minorpentatonicpositionsG.png ├── 01_summary.md ├── Ableton.md ├── tension.md ├── scales_and_emotions.md └── take_it_slow.md ├── today_i_learned.png ├── windows ├── winver.png ├── screenshots.jpg ├── program_associated.png ├── shutdown.md ├── Remove_Stored_Credentials.md ├── when_does_password_expire.md ├── mstsc_without_mouse.md ├── disable_cortana_in_windows_10.md ├── notepad_log_file.md ├── Turn_off_bing_search_results_from_Start_Menu.md ├── screenshot_with_mouse_cursor.md ├── mstsc_black_screen.md └── 01_summary.md ├── crypto ├── pigpen_key.png ├── 01_summary.md └── Braille_alfabet.jpg ├── git ├── git_overview.png ├── Git-Cheat-Sheet.png ├── mercurial_overview.png ├── cheatsheet.md ├── diff.md ├── see_git_folder.md ├── git_bitbucket.md ├── merge_pull_request.md ├── version.md ├── access_github_behind_corporate_proxy.md ├── discard_uncommitted_changes.md └── 01_summary.md ├── http ├── 01_summary.md └── trace.md ├── mailgun ├── blacklist.png ├── blocklist.png ├── blacklists_4.png └── 01_summary.md ├── mercurial ├── rebase1.png ├── rebase2.png ├── revnum.png ├── rebase_example3.png ├── rebase_example4.png ├── rebase_gone_wrong.png ├── hg_push_resulted_in_this.png ├── orig_files.md ├── waiting_for_lock.md ├── ensure_all_files_added.md ├── clone_without_cloning.md ├── find_deleted_files.md ├── git_versus_hg_console_output.md ├── log_template.md ├── mercurial_ini.md ├── push_rainbow.md └── current_extensions.md ├── sql_server ├── format_your_queries.md ├── import_data.png ├── ctrl_e_execute.png ├── cte_pass_the_parcel.png ├── generate-change-script.png ├── import_csv.md ├── where_does_ssms_put_its_queries.sql ├── case_sensitive_string_comparison.md ├── Create_Schema_Authorization.md ├── convert_hex_varchar_to_bigint.md ├── generate_change_script.md ├── sp_heltpext.md ├── simple_recovery_model.md ├── identity_insert_off.md ├── ctrl_e_execute.md ├── drive_sizes.md ├── create_schema_specific_role.md ├── datetime_trim_hours_milliseconds.md ├── start_time.md ├── trailing_cr_lf.md ├── table_re_creation.md └── how_much_space_does_my_db_use.md ├── usql ├── 01_summary.md └── new_project_u_sql.png ├── writing ├── the_block.pdn ├── the_block.png ├── block_align.pdn ├── block_align.png ├── block_misalign.pdn ├── block_misalign.png ├── margin_gutter.pdn ├── margin_gutter.png └── 01_summary.md ├── console ├── CmdEr_Bash.png ├── cmder_rdp_speed.png ├── CmdEr_Paste_Settings.png ├── cmder_tabs_on_bottom.png ├── CmdEr_Color_Scheme_Based_On_Tomorrow.png ├── 01_summary.md ├── consolez.md └── cmder_powershell.md ├── design ├── color-cones.png ├── CIExy1931_MacAdam.png ├── 01_summary.md └── designs_i_love.md ├── gmail ├── dashkard-gmail.png ├── 01_summary.md └── keyboard_shortcuts.md ├── graphics ├── sankeymatic.png ├── sequence_diagram.png ├── showcard_gothic.png ├── sankey.md ├── 01_summary.md ├── bulk_resize_images_with_image_magick.md ├── paint.net_layers.md ├── showcard_gothic.md └── paint.net_select_single_pixel.md ├── gulp ├── getting_started.md └── 01_summary.md ├── math ├── eulers_number.png ├── 01_summary.md └── eulers_number.md ├── notepad++ ├── nth_char.png ├── shortcut_close_document.md ├── trim_trailing_and_save.md ├── 01_summary.md ├── tell_notepad++_about_a_new_file_type.md └── error_downloading_the_plugin_list.md ├── sparql ├── 01_summary.md └── basics.md ├── .gitignore ├── concepts ├── use_a_formula.png ├── survivorship_bias.png ├── art_of_the_data_email.png ├── The_Wisdom_and_or_Madness_of_Crowds.png ├── chainsawsuit_dot_com_20140916-research.png ├── mere_exposure.md ├── opportunity_cost.md ├── happy_path.md ├── getting_unblocked.md ├── regression_to_the_mean.md ├── idea_transmission.md ├── expected_value.md └── follow_up_and_recurring_emails.md ├── csv ├── R_datatable_fread.jpg └── 01_summary.md ├── education ├── 01_summary.md └── links.md ├── excel ├── Given_multiline.png ├── split_to_single_lines_and_copy_associated_text.png ├── 01_summary.md ├── extract_year_and_month_from_date_for_grouping_purposes.md └── if_error.md ├── linqpad ├── add_connection.png ├── find_iq_driver.png ├── delete_iq_driver.png ├── view_more_drivers.png ├── inspect_clipboard_1.png ├── inspect_clipboard_2.png ├── compiler_optimizations.png ├── add_connection_shows_iq_driver.png ├── clear_results.md ├── set_breakpoint.md ├── 01_summary.md └── offline_registration.md ├── office ├── outlook_weather.png ├── settings_celsius.png ├── 01_summary.md └── outlook_calendar_celsius_fahrenheit.md ├── reading_notes ├── Allen_GTD.md ├── Vonn_Five.md ├── Carroll_Bujo.md ├── Debono_child.md ├── Diamond_GGS.md ├── Lindsey_Wins.md ├── Ericsson_Peak.md ├── Grazer_Curious.md ├── Roth_Achievement.md ├── Debono_think.md ├── Sierra_Badass.md ├── Kawasaki_AOS.md ├── Pirsig_Motorcycle.md ├── Frankl_Meaning.md ├── kondo_tidying.md ├── Jiwa_hunch.md ├── Ariely_Payoff.md ├── Duhigg_Habit.md └── Cialdini_influence.md ├── tutorials ├── four_in_a_row.md ├── 01_summary.md └── four_in_a_row_files.png ├── typescript ├── task_runner.png └── 01_summary.md ├── sharepoint ├── find_view_guid.png ├── export_to_excel.png ├── 01_summary.md └── find_view_guid.md ├── speech └── 01_summary.md ├── appharbor └── 01_summary.md ├── habits └── 01_summary.md ├── productivity └── 01_summary.md ├── web ├── 01_summary.md └── instant_websites.md ├── zoho ├── dkim_dns_digital_ocean.png ├── 01_summary.md ├── dkim_dns_digital_ocean_BAD.png └── catch_all.md ├── azure_devops └── 01_summary.md ├── itunes ├── 01_summary.md └── setup_as_new_ipad.md ├── python ├── forge_install_success.png ├── entities_in_minecraft.md ├── input_output.md ├── 01_summary.md ├── pip.md ├── comments.md └── grip.md ├── virtual_box ├── VirtualBoxWarning.png ├── 01_summary.md └── virtual_box_warning.md ├── visual_studio ├── ctor.md ├── Productivity_Power_Tools_Turn_Off_Color_Tabs_By_Project.png ├── nuget_json_dot_net_problem.md ├── tabs_and_spaces.md ├── 01_summary.md ├── html_auto_close_tags.md └── html_surround_with.md ├── banking └── 01_summary.md ├── inkscape ├── 01_summary.md └── font_not_showing.md ├── nuget ├── consolidate_nuget_packages.png ├── 01_summary.md └── consolidate_nuget_packages.md ├── chocolatey ├── list_localonly.md ├── 01_summary.md └── install_chocolatey.md ├── cpu_analyzer └── 01_summary.md ├── css ├── center.md ├── maintainable_css.md ├── 01_summary.md ├── glyph_after_blank_anchors.md └── detect_retina_high_dpi_display.md ├── github ├── 01_summary.md └── github_pages_nojekyll.md ├── go ├── 01_summary.md └── install_go_on_windows_bash.md ├── vs_code ├── launch_vs_code.md ├── 01_summary.md ├── navigate_back.md ├── markdown_preview.md └── keystrokes_expand_collapse.md ├── wordpress └── 01_summary.md ├── google ├── dead_mans_switch.md ├── largest_files_in_gmail.md ├── search_by_file_extension.md ├── post_to_google_sheets.md ├── chrome_reopen_closed_tabs.md ├── chrome_design_mode.md ├── capture_email.html ├── chrome_before_flight.md ├── 01_summary.md └── google_analytics_add_new_site.md ├── paypal └── 01_summary.md ├── jekyll └── 01_summary.md ├── nimbletext ├── 01_summary.md └── convert_date_uk_to_iso.md ├── bower ├── 01_summary.md └── update_bower.md ├── smallbasic └── 01_summary.md ├── javascript ├── console_error.md ├── eval.md ├── random_item.md ├── 01_summary.md ├── add_remove_class.md └── poor_mans_jquery.md ├── react ├── 01_summary.md └── javascript_1.7.md ├── twitter ├── 01_summary.md └── Stop_Automatic_Conversion_To_URLs.md ├── windows.forms ├── toolstrip_renderer_checkitem_right.png ├── toolstrip_renderer_checkitem_wrong.png ├── 01_summary.md ├── DPI_aware_winforms.md ├── using_dark_theme.md └── key_down.md ├── 7z ├── 01_summary.md └── Create_Password_Protected_Zip_File_with_7z.md ├── html ├── 01_summary.md ├── scraping_files.md └── autocomplete_dropdowns.md ├── pdf.css ├── redis └── 01_summary.md ├── saltwater_swimming_pool ├── 01_summary.md └── checklist.md ├── sqlite └── 01_summary.md ├── tools ├── 01_summary.md ├── about_utils.md └── utils_repo.md ├── node └── 01_summary.md ├── pdf ├── 01_summary.md ├── html_to_pdf.md └── markdown_to_pdf.md ├── electron ├── 01_summary.md └── electroncgi.md ├── minecraft ├── 01_summary.md └── commands.md ├── security_virus_spam_etc ├── 01_summary.md ├── google_search_console.md └── virus_total.md ├── memorize ├── 01_summary.md ├── memory_techniques.md └── phonetic_alphabet.md ├── .net_core_MVC ├── UrlEncode.md ├── view_imports.md ├── documenting_asp_net_core.md ├── call_bash ├── call_bash.md ├── bind_post_to_action.md ├── no_authentication_handler.md ├── UrlParameter-Optional.md ├── server_mappath.md ├── error_in_g_cs.md └── 01_summary.md ├── csharp ├── 01_summary.md └── version8.md ├── markdown └── 01_summary.md ├── jquery ├── 01_summary.md └── textarea_keypress.md ├── macbook_air ├── 01_summary.md ├── insert.md ├── print_screen.md ├── serial_number.md └── bluetooth_controller.md ├── book.json ├── iis ├── 01_summary.md ├── which_version.md └── where_to_find_the_logs_for_a_site.md ├── stackexchange ├── 01_summary.md ├── back_off.md └── closed_questions_with_Given_Tags.md ├── library └── 01_summary.md ├── oracle ├── date_literal.md ├── what_version_of_oracle.md ├── 01_summary.md ├── top_10.md ├── get_text_of_view.md └── instant_client.md ├── sleep ├── 01_summary.md ├── sleep_terminology.md └── why_sleep.md ├── .net ├── parse_exact.md ├── 01_summary.md ├── zipfile.md ├── config_external_source.md └── override_equals.md ├── sql_spatial └── 01_summary.md ├── asp.net_mvc ├── select_multi_dropdowns.md ├── 01_summary.md └── helpful_error_page.md ├── sql_server_reporting_services ├── 01_summary.md ├── view_report_data.md └── reports_are_blank_in_chrome.md ├── .ok ├── cover.txt ├── gitbook ├── 01_summary.md ├── custom_css.md ├── add_google_analytics_to_gitbook.md └── host_on_custom_subdomain.md └── chapter_summary.txt /marketing/logo.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marketing/content.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marketing/launch.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marketing/brand_identity.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marketing/positioning.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /powershell/Message_of_the_day.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/cover.jpg -------------------------------------------------------------------------------- /cover.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/cover.pdn -------------------------------------------------------------------------------- /npm/amd.md: -------------------------------------------------------------------------------- 1 | # AMD 2 | 3 | Asynchronous Module Definition 4 | 5 | -------------------------------------------------------------------------------- /.bookignore: -------------------------------------------------------------------------------- 1 | *.ps1 2 | *.pre 3 | chapter_summary.txt 4 | .ok 5 | cover.txt 6 | -------------------------------------------------------------------------------- /powershell/elevate.md: -------------------------------------------------------------------------------- 1 | ## To elevate the prompt... 2 | 3 | see [runas.md] 4 | -------------------------------------------------------------------------------- /yfp_book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/yfp_book.png -------------------------------------------------------------------------------- /google635fcc2a99165998.html: -------------------------------------------------------------------------------- 1 | google-site-verification: google635fcc2a99165998.html -------------------------------------------------------------------------------- /linux/apt_get.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/linux/apt_get.md -------------------------------------------------------------------------------- /angular/welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/angular/welcome.png -------------------------------------------------------------------------------- /music/quadrants.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/music/quadrants.pdn -------------------------------------------------------------------------------- /music/quadrants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/music/quadrants.png -------------------------------------------------------------------------------- /npm/NPMTabRun2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/npm/NPMTabRun2.gif -------------------------------------------------------------------------------- /today_i_learned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/today_i_learned.png -------------------------------------------------------------------------------- /windows/winver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/windows/winver.png -------------------------------------------------------------------------------- /crypto/pigpen_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/crypto/pigpen_key.png -------------------------------------------------------------------------------- /git/git_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/git/git_overview.png -------------------------------------------------------------------------------- /http/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # http 3 | ### chapter contents 4 | 5 | * [trace](trace.md) 6 | -------------------------------------------------------------------------------- /mailgun/blacklist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/mailgun/blacklist.png -------------------------------------------------------------------------------- /mailgun/blocklist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/mailgun/blocklist.png -------------------------------------------------------------------------------- /mercurial/rebase1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/mercurial/rebase1.png -------------------------------------------------------------------------------- /mercurial/rebase2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/mercurial/rebase2.png -------------------------------------------------------------------------------- /mercurial/revnum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/mercurial/revnum.png -------------------------------------------------------------------------------- /sql_server/format_your_queries.md: -------------------------------------------------------------------------------- 1 | # Format your queries... 2 | 3 | With -------------------------------------------------------------------------------- /usql/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # usql 3 | ### chapter contents 4 | 5 | * [basics](basics.md) 6 | -------------------------------------------------------------------------------- /writing/the_block.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/writing/the_block.pdn -------------------------------------------------------------------------------- /writing/the_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/writing/the_block.png -------------------------------------------------------------------------------- /console/CmdEr_Bash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/console/CmdEr_Bash.png -------------------------------------------------------------------------------- /design/color-cones.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/design/color-cones.png -------------------------------------------------------------------------------- /git/Git-Cheat-Sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/git/Git-Cheat-Sheet.png -------------------------------------------------------------------------------- /gmail/dashkard-gmail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/gmail/dashkard-gmail.png -------------------------------------------------------------------------------- /graphics/sankeymatic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/graphics/sankeymatic.png -------------------------------------------------------------------------------- /gulp/getting_started.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/gulp/getting_started.md -------------------------------------------------------------------------------- /mailgun/blacklists_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/mailgun/blacklists_4.png -------------------------------------------------------------------------------- /math/eulers_number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/math/eulers_number.png -------------------------------------------------------------------------------- /notepad++/nth_char.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/notepad++/nth_char.png -------------------------------------------------------------------------------- /sparql/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # sparql 3 | ### chapter contents 4 | 5 | * [basics](basics.md) 6 | -------------------------------------------------------------------------------- /windows/screenshots.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/windows/screenshots.jpg -------------------------------------------------------------------------------- /writing/block_align.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/writing/block_align.pdn -------------------------------------------------------------------------------- /writing/block_align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/writing/block_align.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .ok 2 | *.ps1 3 | *.pre 4 | book.pdf 5 | cover.txt 6 | chapter_summary.txt 7 | _book/ 8 | -------------------------------------------------------------------------------- /concepts/use_a_formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/concepts/use_a_formula.png -------------------------------------------------------------------------------- /crypto/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # crypto 3 | ### chapter contents 4 | 5 | * [spy codes](spy_codes.md) 6 | -------------------------------------------------------------------------------- /crypto/Braille_alfabet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/crypto/Braille_alfabet.jpg -------------------------------------------------------------------------------- /csv/R_datatable_fread.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/csv/R_datatable_fread.jpg -------------------------------------------------------------------------------- /education/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # education 3 | ### chapter contents 4 | 5 | * [links](links.md) 6 | -------------------------------------------------------------------------------- /excel/Given_multiline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/excel/Given_multiline.png -------------------------------------------------------------------------------- /git/mercurial_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/git/mercurial_overview.png -------------------------------------------------------------------------------- /linqpad/add_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/linqpad/add_connection.png -------------------------------------------------------------------------------- /linqpad/find_iq_driver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/linqpad/find_iq_driver.png -------------------------------------------------------------------------------- /mailgun/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # mailgun 3 | ### chapter contents 4 | 5 | * [blocklist](blocklist.md) 6 | -------------------------------------------------------------------------------- /office/outlook_weather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/office/outlook_weather.png -------------------------------------------------------------------------------- /powershell/Random.md: -------------------------------------------------------------------------------- 1 | # Get a random number in Powershell 2 | 3 | Get a random number with Get-Random -------------------------------------------------------------------------------- /reading_notes/Allen_GTD.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/reading_notes/Allen_GTD.md -------------------------------------------------------------------------------- /reading_notes/Vonn_Five.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/reading_notes/Vonn_Five.md -------------------------------------------------------------------------------- /sql_server/import_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/sql_server/import_data.png -------------------------------------------------------------------------------- /tutorials/four_in_a_row.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/tutorials/four_in_a_row.md -------------------------------------------------------------------------------- /typescript/task_runner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/typescript/task_runner.png -------------------------------------------------------------------------------- /usql/new_project_u_sql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/usql/new_project_u_sql.png -------------------------------------------------------------------------------- /writing/block_misalign.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/writing/block_misalign.pdn -------------------------------------------------------------------------------- /writing/block_misalign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/writing/block_misalign.png -------------------------------------------------------------------------------- /writing/margin_gutter.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/writing/margin_gutter.pdn -------------------------------------------------------------------------------- /writing/margin_gutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/writing/margin_gutter.png -------------------------------------------------------------------------------- /console/cmder_rdp_speed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/console/cmder_rdp_speed.png -------------------------------------------------------------------------------- /design/CIExy1931_MacAdam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/design/CIExy1931_MacAdam.png -------------------------------------------------------------------------------- /graphics/sequence_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/graphics/sequence_diagram.png -------------------------------------------------------------------------------- /graphics/showcard_gothic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/graphics/showcard_gothic.png -------------------------------------------------------------------------------- /linqpad/delete_iq_driver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/linqpad/delete_iq_driver.png -------------------------------------------------------------------------------- /linqpad/view_more_drivers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/linqpad/view_more_drivers.png -------------------------------------------------------------------------------- /mercurial/rebase_example3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/mercurial/rebase_example3.png -------------------------------------------------------------------------------- /mercurial/rebase_example4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/mercurial/rebase_example4.png -------------------------------------------------------------------------------- /office/settings_celsius.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/office/settings_celsius.png -------------------------------------------------------------------------------- /powershell/Use_Google_Maps.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/powershell/Use_Google_Maps.md -------------------------------------------------------------------------------- /reading_notes/Carroll_Bujo.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/reading_notes/Carroll_Bujo.md -------------------------------------------------------------------------------- /reading_notes/Debono_child.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/reading_notes/Debono_child.md -------------------------------------------------------------------------------- /reading_notes/Diamond_GGS.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/reading_notes/Diamond_GGS.md -------------------------------------------------------------------------------- /reading_notes/Lindsey_Wins.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/reading_notes/Lindsey_Wins.md -------------------------------------------------------------------------------- /sharepoint/find_view_guid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/sharepoint/find_view_guid.png -------------------------------------------------------------------------------- /speech/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # speech 3 | ### chapter contents 4 | 5 | * [copy voices](copy_voices.md) 6 | -------------------------------------------------------------------------------- /sql_server/ctrl_e_execute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/sql_server/ctrl_e_execute.png -------------------------------------------------------------------------------- /appharbor/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # appharbor 3 | ### chapter contents 4 | 5 | * [keep alive](keep_alive.md) 6 | -------------------------------------------------------------------------------- /concepts/survivorship_bias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/concepts/survivorship_bias.png -------------------------------------------------------------------------------- /gulp/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # gulp 3 | ### chapter contents 4 | 5 | * [getting started](getting_started.md) 6 | -------------------------------------------------------------------------------- /habits/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # habits 3 | ### chapter contents 4 | 5 | * [power of habits](power_of_habits.md) 6 | -------------------------------------------------------------------------------- /linqpad/inspect_clipboard_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/linqpad/inspect_clipboard_1.png -------------------------------------------------------------------------------- /linqpad/inspect_clipboard_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/linqpad/inspect_clipboard_2.png -------------------------------------------------------------------------------- /mercurial/rebase_gone_wrong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/mercurial/rebase_gone_wrong.png -------------------------------------------------------------------------------- /productivity/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # productivity 3 | ### chapter contents 4 | 5 | * [general](general.md) 6 | -------------------------------------------------------------------------------- /reading_notes/Ericsson_Peak.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/reading_notes/Ericsson_Peak.md -------------------------------------------------------------------------------- /reading_notes/Grazer_Curious.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/reading_notes/Grazer_Curious.md -------------------------------------------------------------------------------- /sharepoint/export_to_excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/sharepoint/export_to_excel.png -------------------------------------------------------------------------------- /web/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # web 3 | ### chapter contents 4 | 5 | * [instant websites](instant_websites.md) 6 | -------------------------------------------------------------------------------- /windows/program_associated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/windows/program_associated.png -------------------------------------------------------------------------------- /windows/shutdown.md: -------------------------------------------------------------------------------- 1 | # shutdown from commandline 2 | 3 | To shutdown a machine use: 4 | 5 | shutdown /s 6 | -------------------------------------------------------------------------------- /zoho/dkim_dns_digital_ocean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/zoho/dkim_dns_digital_ocean.png -------------------------------------------------------------------------------- /azure_devops/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # azure devops 3 | ### chapter contents 4 | 5 | * [wiql editor](wiql_editor.md) 6 | -------------------------------------------------------------------------------- /concepts/art_of_the_data_email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/concepts/art_of_the_data_email.png -------------------------------------------------------------------------------- /console/CmdEr_Paste_Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/console/CmdEr_Paste_Settings.png -------------------------------------------------------------------------------- /console/cmder_tabs_on_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/console/cmder_tabs_on_bottom.png -------------------------------------------------------------------------------- /gmail/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # gmail 3 | ### chapter contents 4 | 5 | * [keyboard shortcuts](keyboard_shortcuts.md) 6 | -------------------------------------------------------------------------------- /itunes/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # itunes 3 | ### chapter contents 4 | 5 | * [setup as new ipad](setup_as_new_ipad.md) 6 | -------------------------------------------------------------------------------- /linqpad/compiler_optimizations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/linqpad/compiler_optimizations.png -------------------------------------------------------------------------------- /music/dorian_aeolian_phrygian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/music/dorian_aeolian_phrygian.png -------------------------------------------------------------------------------- /music/majorheptatonicpositions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/music/majorheptatonicpositions.png -------------------------------------------------------------------------------- /music/majorpentatonicpositions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/music/majorpentatonicpositions.gif -------------------------------------------------------------------------------- /music/majorpentatonicpositions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/music/majorpentatonicpositions.png -------------------------------------------------------------------------------- /music/minorheptatonicpositions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/music/minorheptatonicpositions.png -------------------------------------------------------------------------------- /music/minorpentatonicpositions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/music/minorpentatonicpositions.gif -------------------------------------------------------------------------------- /python/forge_install_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/python/forge_install_success.png -------------------------------------------------------------------------------- /reading_notes/Roth_Achievement.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/reading_notes/Roth_Achievement.md -------------------------------------------------------------------------------- /sql_server/cte_pass_the_parcel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/sql_server/cte_pass_the_parcel.png -------------------------------------------------------------------------------- /tutorials/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # tutorials 3 | ### chapter contents 4 | 5 | * [four in a row](four_in_a_row.md) 6 | -------------------------------------------------------------------------------- /tutorials/four_in_a_row_files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/tutorials/four_in_a_row_files.png -------------------------------------------------------------------------------- /virtual_box/VirtualBoxWarning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/virtual_box/VirtualBoxWarning.png -------------------------------------------------------------------------------- /visual_studio/ctor.md: -------------------------------------------------------------------------------- 1 | ## use "ctor"[tab] to create a constructor. 2 | 3 | use `ctor[tab]` to create a constructor. -------------------------------------------------------------------------------- /banking/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # banking 3 | ### chapter contents 4 | 5 | * [convert ofx to csv](convert_ofx_to_csv.md) 6 | -------------------------------------------------------------------------------- /inkscape/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # inkscape 3 | ### chapter contents 4 | 5 | * [font not showing](font_not_showing.md) 6 | -------------------------------------------------------------------------------- /music/minorpentatonicpositionsG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/music/minorpentatonicpositionsG.png -------------------------------------------------------------------------------- /nuget/consolidate_nuget_packages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/nuget/consolidate_nuget_packages.png -------------------------------------------------------------------------------- /powershell/diff_between_two_dates.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/powershell/diff_between_two_dates.md -------------------------------------------------------------------------------- /sharepoint/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # sharepoint 3 | ### chapter contents 4 | 5 | * [find view guid](find_view_guid.md) 6 | -------------------------------------------------------------------------------- /typescript/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # typescript 3 | ### chapter contents 4 | 5 | * [getting started](getting_started.md) 6 | -------------------------------------------------------------------------------- /zoho/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # zoho 3 | ### chapter contents 4 | 5 | * [catch all](catch_all.md) 6 | * [domain](domain.md) 7 | -------------------------------------------------------------------------------- /zoho/dkim_dns_digital_ocean_BAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/zoho/dkim_dns_digital_ocean_BAD.png -------------------------------------------------------------------------------- /chocolatey/list_localonly.md: -------------------------------------------------------------------------------- 1 | # To List the packages installed 2 | 3 | choco list -lo 4 | choco list --localonly 5 | -------------------------------------------------------------------------------- /cpu_analyzer/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # cpu analyzer 3 | ### chapter contents 4 | 5 | * [getting started](getting_started.md) 6 | -------------------------------------------------------------------------------- /css/center.md: -------------------------------------------------------------------------------- 1 | # How to center in CSS 2 | 3 | Just visit: 4 | 5 | [http://howtocenterincss.com/](http://howtocenterincss.com/) -------------------------------------------------------------------------------- /github/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # github 3 | ### chapter contents 4 | 5 | * [github pages nojekyll](github_pages_nojekyll.md) 6 | -------------------------------------------------------------------------------- /go/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # go 3 | ### chapter contents 4 | 5 | * [install go on windows bash](install_go_on_windows_bash.md) 6 | -------------------------------------------------------------------------------- /math/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # math 3 | ### chapter contents 4 | 5 | * [eulers number](eulers_number.md) 6 | * [log](log.md) 7 | -------------------------------------------------------------------------------- /mercurial/hg_push_resulted_in_this.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/mercurial/hg_push_resulted_in_this.png -------------------------------------------------------------------------------- /powershell/Run_Runas_Administrator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/powershell/Run_Runas_Administrator.jpg -------------------------------------------------------------------------------- /sql_server/generate-change-script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/sql_server/generate-change-script.png -------------------------------------------------------------------------------- /vs_code/launch_vs_code.md: -------------------------------------------------------------------------------- 1 | # Launch VS code 2 | 3 | code . 4 | 5 | That will launch vs-code, focused on the current folder. -------------------------------------------------------------------------------- /wordpress/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # wordpress 3 | ### chapter contents 4 | 5 | * [wp on digital ocean](wp_on_digital_ocean.md) 6 | -------------------------------------------------------------------------------- /csv/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # csv 3 | ### chapter contents 4 | 5 | * [import csv to db](import_csv_to_db.md) 6 | * [tools](tools.md) 7 | -------------------------------------------------------------------------------- /google/dead_mans_switch.md: -------------------------------------------------------------------------------- 1 | ## Dead man's switch at google 2 | 3 | See 4 | 5 | -------------------------------------------------------------------------------- /google/largest_files_in_gmail.md: -------------------------------------------------------------------------------- 1 | # how to find your largest files in gmail 2 | 3 | search like this, 4 | 5 | size:20000000 -------------------------------------------------------------------------------- /paypal/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # paypal 3 | ### chapter contents 4 | 5 | * [download custom daterange](download_custom_daterange.md) 6 | -------------------------------------------------------------------------------- /jekyll/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # jekyll 3 | ### chapter contents 4 | 5 | * [getting started on windows](getting_started_on_windows.md) 6 | -------------------------------------------------------------------------------- /linqpad/add_connection_shows_iq_driver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/linqpad/add_connection_shows_iq_driver.png -------------------------------------------------------------------------------- /nimbletext/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # nimbletext 3 | ### chapter contents 4 | 5 | * [convert date uk to iso](convert_date_uk_to_iso.md) 6 | -------------------------------------------------------------------------------- /bower/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # bower 3 | ### chapter contents 4 | 5 | * [bower init](bower_init.md) 6 | * [update bower](update_bower.md) 7 | -------------------------------------------------------------------------------- /smallbasic/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # smallbasic 3 | ### chapter contents 4 | 5 | * [shortcomings of smallbasic](shortcomings_of_smallbasic.md) 6 | -------------------------------------------------------------------------------- /angular/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # angular 3 | ### chapter contents 4 | 5 | * [getting started deborah kurata](getting_started_deborah_kurata.md) 6 | -------------------------------------------------------------------------------- /concepts/The_Wisdom_and_or_Madness_of_Crowds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/concepts/The_Wisdom_and_or_Madness_of_Crowds.png -------------------------------------------------------------------------------- /console/CmdEr_Color_Scheme_Based_On_Tomorrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/console/CmdEr_Color_Scheme_Based_On_Tomorrow.png -------------------------------------------------------------------------------- /javascript/console_error.md: -------------------------------------------------------------------------------- 1 | # Write errors to the console Want to write an error to the console? console.error("an error occurred", details); -------------------------------------------------------------------------------- /sql_server/import_csv.md: -------------------------------------------------------------------------------- 1 | # Import CSV using SSMS tools 2 | 3 | Right click on the database, select 'tasks' and 'import flat file...' 4 | 5 | 6 | -------------------------------------------------------------------------------- /concepts/chainsawsuit_dot_com_20140916-research.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/concepts/chainsawsuit_dot_com_20140916-research.png -------------------------------------------------------------------------------- /office/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # office 3 | ### chapter contents 4 | 5 | * [outlook calendar celsius fahrenheit](outlook_calendar_celsius_fahrenheit.md) 6 | -------------------------------------------------------------------------------- /react/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # react 3 | ### chapter contents 4 | 5 | * [getting started](getting_started.md) 6 | * [javascript 1.7](javascript_1.7.md) 7 | -------------------------------------------------------------------------------- /twitter/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # twitter 3 | ### chapter contents 4 | 5 | * [Stop Automatic Conversion To URLs](Stop_Automatic_Conversion_To_URLs.md) 6 | -------------------------------------------------------------------------------- /design/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # design 3 | ### chapter contents 4 | 5 | * [color resources](color_resources.md) 6 | * [designs i love](designs_i_love.md) 7 | -------------------------------------------------------------------------------- /windows.forms/toolstrip_renderer_checkitem_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/windows.forms/toolstrip_renderer_checkitem_right.png -------------------------------------------------------------------------------- /windows.forms/toolstrip_renderer_checkitem_wrong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/windows.forms/toolstrip_renderer_checkitem_wrong.png -------------------------------------------------------------------------------- /7z/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # 7z 3 | ### chapter contents 4 | 5 | * [Create Password Protected Zip File with 7z](Create_Password_Protected_Zip_File_with_7z.md) 6 | -------------------------------------------------------------------------------- /excel/split_to_single_lines_and_copy_associated_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/excel/split_to_single_lines_and_copy_associated_text.png -------------------------------------------------------------------------------- /writing/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # writing 3 | ### chapter contents 4 | 5 | * [50 writing tools](50_writing_tools.md) 6 | * [amateur mistakes](amateur_mistakes.md) 7 | -------------------------------------------------------------------------------- /html/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # html 3 | ### chapter contents 4 | 5 | * [autocomplete dropdowns](autocomplete_dropdowns.md) 6 | * [scraping files](scraping_files.md) 7 | -------------------------------------------------------------------------------- /linux/what_my_ip_address.md: -------------------------------------------------------------------------------- 1 | # To find the IP Address of a linux machine 2 | 3 | ...from bash: 4 | 5 | 6 | dig +short myip.opendns.com @resolver1.opendns.com 7 | -------------------------------------------------------------------------------- /pdf.css: -------------------------------------------------------------------------------- 1 | pre { 2 | word-break: break-all; 3 | /* Non standard for webkit, but it does work on the Mac when generating the PDF */ 4 | word-break: break-word; 5 | } -------------------------------------------------------------------------------- /redis/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # redis 3 | ### chapter contents 4 | 5 | * [getting started](getting_started.md) 6 | * [redis desktop manager](redis_desktop_manager.md) 7 | -------------------------------------------------------------------------------- /nuget/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # nuget 3 | ### chapter contents 4 | 5 | * [consolidate nuget packages](consolidate_nuget_packages.md) 6 | * [nuget proxy](nuget_proxy.md) 7 | -------------------------------------------------------------------------------- /saltwater_swimming_pool/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # saltwater swimming pool 3 | ### chapter contents 4 | 5 | * [checklist](checklist.md) 6 | * [happy path](happy_path.md) 7 | -------------------------------------------------------------------------------- /sqlite/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # sqlite 3 | ### chapter contents 4 | 5 | * [dapper struggles with dynamic types of sqlite](dapper_struggles_with_dynamic_types_of_sqlite.md) 6 | -------------------------------------------------------------------------------- /tools/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # tools 3 | ### chapter contents 4 | 5 | * [about utils](about_utils.md) 6 | * [list of tools](list_of_tools.md) 7 | * [utils repo](utils_repo.md) 8 | -------------------------------------------------------------------------------- /linux/rename_files_with_mv.md: -------------------------------------------------------------------------------- 1 | # Rename files with `mv` command 2 | 3 | In linux, don't use `ren` to rename files - use `mv` 4 | 5 | That's right: move the file to its new location. -------------------------------------------------------------------------------- /node/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # node 3 | ### chapter contents 4 | 5 | * [install node on ubuntu wsl](install_node_on_ubuntu_wsl.md) 6 | * [webserver express](webserver_express.md) 7 | -------------------------------------------------------------------------------- /pdf/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # pdf 3 | ### chapter contents 4 | 5 | * [html to pdf](html_to_pdf.md) 6 | * [markdown to pdf](markdown_to_pdf.md) 7 | * [pdf to epub](pdf_to_epub.md) 8 | -------------------------------------------------------------------------------- /electron/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # electron 3 | ### chapter contents 4 | 5 | * [electroncgi](electroncgi.md) 6 | * [getting started](getting_started.md) 7 | * [save to file](save_to_file.md) 8 | -------------------------------------------------------------------------------- /google/search_by_file_extension.md: -------------------------------------------------------------------------------- 1 | # FileType 2 | 3 | To search google for files with a specific file extension use the "filetype:" command, for example: 4 | 5 | padgen Win10 filetype:xml -------------------------------------------------------------------------------- /minecraft/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # minecraft 3 | ### chapter contents 4 | 5 | * [commands](commands.md) 6 | * [mark jump in minecraft](mark_jump_in_minecraft.md) 7 | * [useful](useful.md) 8 | -------------------------------------------------------------------------------- /python/entities_in_minecraft.md: -------------------------------------------------------------------------------- 1 | # Entity Types in Minecraft 2 | 3 | These are all of the entity types in minecraft, for use in the [python in minecraft](python_in_minecraft.md) exercises. 4 | -------------------------------------------------------------------------------- /security_virus_spam_etc/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # security virus spam etc 3 | ### chapter contents 4 | 5 | * [google search console](google_search_console.md) 6 | * [virus total](virus_total.md) 7 | -------------------------------------------------------------------------------- /visual_studio/Productivity_Power_Tools_Turn_Off_Color_Tabs_By_Project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretGeek/til/HEAD/visual_studio/Productivity_Power_Tools_Turn_Off_Color_Tabs_By_Project.png -------------------------------------------------------------------------------- /powershell/download_webpage_to_file.md: -------------------------------------------------------------------------------- 1 | # Download a webpage to a file, from Powershell 2 | 3 | Really easy.... 4 | 5 | (Invoke-WebRequest -URI "http://example.com/index.html").content | out-file "index.html" -------------------------------------------------------------------------------- /powershell/multi-line_comments.md: -------------------------------------------------------------------------------- 1 | # Multi line comments in powershell 2 | 3 | Apparently it's done with this variety of bee string <# #> 4 | 5 | <# 6 | Embed multiline comments in powershell 7 | #> -------------------------------------------------------------------------------- /memorize/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # memorize 3 | ### chapter contents 4 | 5 | * [memory techniques](memory_techniques.md) 6 | * [phonetic alphabet](phonetic_alphabet.md) 7 | * [spaced repetition](spaced_repetition.md) 8 | -------------------------------------------------------------------------------- /powershell/see_function_definition.md: -------------------------------------------------------------------------------- 1 | # See Function Definition 2 | 3 | A quick way to see a function definition 4 | 5 | (e.g. to see the definition of nprof...) 6 | 7 | dir function:nprof | % { $_.definition } -------------------------------------------------------------------------------- /virtual_box/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # virtual box 3 | ### chapter contents 4 | 5 | * [virtual box requires hyper v disabled](virtual_box_requires_hyper_v_disabled.md) 6 | * [virtual box warning](virtual_box_warning.md) 7 | -------------------------------------------------------------------------------- /windows/Remove_Stored_Credentials.md: -------------------------------------------------------------------------------- 1 | # Remove stored credentials 2 | 3 | 4 | Stored credentails getting you down? View them (and remove them) with this one weird trick... 5 | 6 | rundll32.exe keymgr.dll,KRShowKeyMgr -------------------------------------------------------------------------------- /.net_core_MVC/UrlEncode.md: -------------------------------------------------------------------------------- 1 | # Url Encode 2 | 3 | Previously... 4 | 5 | Url.Encode 6 | 7 | But now... 8 | 9 | WebUtility.UrlEncode 10 | 11 | ## See also 12 | 13 | * -------------------------------------------------------------------------------- /linqpad/clear_results.md: -------------------------------------------------------------------------------- 1 | # Clear results.... 2 | 3 | As easy as: 4 | 5 | Util.ClearResults(); 6 | 7 | ## Reference 8 | 9 | * [Possible to clear the LINQPad results window with code?](http://stackoverflow.com/a/4928786) -------------------------------------------------------------------------------- /sql_server/where_does_ssms_put_its_queries.sql: -------------------------------------------------------------------------------- 1 | # Where does SSMS put queries before they've been saved? 2 | 3 | Where does SQL Server Management Studio put its temp queries? 4 | 5 | dir $env:LOCALAPPDATA\Temp\~vs*.sql 6 | -------------------------------------------------------------------------------- /csharp/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # csharp 3 | ### chapter contents 4 | 5 | * [version4](version4.md) 6 | * [version5](version5.md) 7 | * [version6](version6.md) 8 | * [version7](version7.md) 9 | * [version8](version8.md) 10 | -------------------------------------------------------------------------------- /git/cheatsheet.md: -------------------------------------------------------------------------------- 1 | # git cheat sheet 2 | 3 | ![git cheat sheet from rebel labs](Git-Cheat-Sheet.png 'git cheatsheet') 4 | 5 | ## Source 6 | 7 | http://zeroturnaround.com/rebellabs/git-commands-and-best-practices-cheat-sheet/ 8 | -------------------------------------------------------------------------------- /markdown/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # markdown 3 | ### chapter contents 4 | 5 | * [links containing parens](links_containing_parens.md) 6 | * [phone based document editing](phone_based_document_editing.md) 7 | * [syntax](syntax.md) 8 | -------------------------------------------------------------------------------- /powershell/tree.md: -------------------------------------------------------------------------------- 1 | #Tree 2 | 3 | tree command is great 4 | 5 | > tree 6 | C:. 7 | +---asp.net_MVC 8 | +---powershell 9 | +---visual_studio 10 | 11 | and to see files: 12 | 13 | tree /f 14 | -------------------------------------------------------------------------------- /javascript/eval.md: -------------------------------------------------------------------------------- 1 | # Eval is Evil, so use this instead 2 | 3 | new Function("alert('Hello, world!');")(); 4 | 5 | 6 | from [slide 48: coding while you commute](http://www.secretgeek.net/higgins/slides_alt_net.html#48) -------------------------------------------------------------------------------- /jquery/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # jquery 3 | ### chapter contents 4 | 5 | * [adhoc webscraping with jquery](adhoc_webscraping_with_jquery.md) 6 | * [datatables alert](datatables_alert.md) 7 | * [textarea keypress](textarea_keypress.md) 8 | -------------------------------------------------------------------------------- /macbook_air/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # macbook air 3 | ### chapter contents 4 | 5 | * [bluetooth controller](bluetooth_controller.md) 6 | * [insert](insert.md) 7 | * [print screen](print_screen.md) 8 | * [serial number](serial_number.md) 9 | -------------------------------------------------------------------------------- /notepad++/shortcut_close_document.md: -------------------------------------------------------------------------------- 1 | # use F4 to close documents 2 | 3 | By default, `Ctrl W` is `close document`. 4 | 5 | Change it to the common windows shortcut, `ctrl F4`, via: 6 | 7 | Settings | Shortcut mapper | Close | Ctrl + F4 8 | -------------------------------------------------------------------------------- /book.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Today I Learned", 3 | "author": "Leon Bambrick", 4 | "plugins": ["ga"], 5 | "pluginsConfig": { 6 | "ga": { 7 | "token": "UA-41788989-3" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /console/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # console 3 | ### chapter contents 4 | 5 | * [cmder](cmder.md) 6 | * [cmder powershell](cmder_powershell.md) 7 | * [consolez](consolez.md) 8 | * [ndesk options](ndesk_options.md) 9 | * [settings](settings.md) 10 | -------------------------------------------------------------------------------- /iis/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # iis 3 | ### chapter contents 4 | 5 | * [where to find the logs for a site](where_to_find_the_logs_for_a_site.md) 6 | * [which version](which_version.md) 7 | * [which w3wp process is which](which_w3wp_process_is_which.md) 8 | -------------------------------------------------------------------------------- /reading_notes/Debono_think.md: -------------------------------------------------------------------------------- 1 | # THINK! Before it's too late Edward DeBono 2 | 3 | 4 | 5 | The only thinking we're traditionally taught is problem solving. But this isn't enough. 6 | 7 | We need to learn tools of thinking. 8 | 9 | 10 | -------------------------------------------------------------------------------- /stackexchange/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # stackexchange 3 | ### chapter contents 4 | 5 | * [back off](back_off.md) 6 | * [closed questions with Given Tags](closed_questions_with_Given_Tags.md) 7 | * [data query close reasons](data_query_close_reasons.md) 8 | -------------------------------------------------------------------------------- /css/maintainable_css.md: -------------------------------------------------------------------------------- 1 | # Maintainable CSS 2 | 3 | An approach to creating CSS for an application in a way that ensures it will stay readable, sane, and maintainable over time. 4 | 5 | 6 | 7 | * [http://maintainablecss.com/](http://maintainablecss.com/) -------------------------------------------------------------------------------- /gmail/keyboard_shortcuts.md: -------------------------------------------------------------------------------- 1 | # gmail keyboard shortcuts 2 | 3 | ![keyboard shortcuts gmail](dashkard-gmail.png 'keyboard shortcuts') 4 | 5 | ## Sources: 6 | 7 | * http://dashkards.com/gmail 8 | * https://support.google.com/mail/answer/6594?hl=en 9 | -------------------------------------------------------------------------------- /library/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # library 3 | ### chapter contents 4 | 5 | * [ebooks and audiobooks](ebooks_and_audiobooks.md) 6 | * [free ebooks](free_ebooks.md) 7 | * [internet archive download tool](internet_archive_download_tool.md) 8 | * [kanopy](kanopy.md) 9 | -------------------------------------------------------------------------------- /reading_notes/Sierra_Badass.md: -------------------------------------------------------------------------------- 1 | # Badass book Kathy Sierra 2 | 3 | 4 | * Dreyfus skill acquisition model 5 | * Expertise 6 | * Intuition 7 | * The brain doesn't let you in on what it's learning 8 | * Deliberate practice 9 | * Mindset 10 | 11 | 12 | -------------------------------------------------------------------------------- /oracle/date_literal.md: -------------------------------------------------------------------------------- 1 | # How to Query via a Date Literal in Oracle 2 | 3 | 4 | You can refer to a literal date like this: 5 | 6 | 7 | WO.REPORTDATE >= date'2017-07-23' 8 | 9 | 10 | Can also convert a string to a date time like this: 11 | 12 | 13 | -------------------------------------------------------------------------------- /powershell/parts_of_a_fileSystemInfo_object.md: -------------------------------------------------------------------------------- 1 | # Get Parts of a FileSystemInfo object (such as FileName Without Extension) 2 | 3 | (Typo above, I meant `FileInfo` not `FileSystemInfo`) 4 | 5 | * See [Get Parts of a FileInfo object](parts_of_a_fileInfo_object.md) -------------------------------------------------------------------------------- /sql_server/case_sensitive_string_comparison.md: -------------------------------------------------------------------------------- 1 | # Case Sensitive String Comparison 2 | 3 | 4 | Make a comparison behave in a case-sensitive manner by applying a case-sensitive collation 5 | 6 | Select 'Hello' 7 | where 'A' = 'a' COLLATE Latin1_General_CS_AS 8 | -------------------------------------------------------------------------------- /powershell/max_of_two_values.md: -------------------------------------------------------------------------------- 1 | # Maximum of two values (or minimum) 2 | 3 | To return the largest of two numbers: 4 | 5 | [Math]::Max(1,2) 6 | 7 | ...returns `2`. 8 | 9 | 10 | Similarly: 11 | 12 | [Math]::Max(1,2) 13 | 14 | ...returns `1`. 15 | 16 | -------------------------------------------------------------------------------- /electron/electroncgi.md: -------------------------------------------------------------------------------- 1 | # Electron CGI for .net core with Electron apps 2 | 3 | https://www.blinkingcaret.com/2019/11/27/electroncgi-a-solution-to-cross-platform-guis-for-net-core/ 4 | 5 | ElectronCGI – A solution to cross-platform GUIs for .Net Core 6 | 7 | ....interesting. -------------------------------------------------------------------------------- /macbook_air/insert.md: -------------------------------------------------------------------------------- 1 | # How to press the insert key on a MacBook Air (running Windows) 2 | 3 | On a MacBook Air running windows: 4 | insert key: [fn] + [enter] 5 | Hence: shift + insert == [fn] + [shift] + [enter] 6 | Hence: ctrl + insert == [fn] + [ctrl] + [enter] 7 | 8 | -------------------------------------------------------------------------------- /marketing/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # marketing 3 | ### chapter contents 4 | 5 | * [brand identity](brand_identity.md) 6 | * [content](content.md) 7 | * [influencer](influencer.md) 8 | * [launch](launch.md) 9 | * [logo](logo.md) 10 | * [positioning](positioning.md) 11 | -------------------------------------------------------------------------------- /oracle/what_version_of_oracle.md: -------------------------------------------------------------------------------- 1 | # How can you tell which version of oracle the server is running 2 | 3 | SELECT * FROM PRODUCT_COMPONENT_VERSION 4 | 5 | ## Source 6 | 7 | * 8 | 9 | 10 | -------------------------------------------------------------------------------- /powershell/sleep_milliseconds.md: -------------------------------------------------------------------------------- 1 | # Sleep for N Milliseconds 2 | 3 | 4 | You can sleep for 10 whole seconds with: 5 | 6 | 7 | Start-Sleep 10 8 | 9 | 10 | But you can sleep for a mere 10 *Milliseconds* with 11 | 12 | Start-Sleep -Milliseconds 10 13 | 14 | -------------------------------------------------------------------------------- /sleep/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # sleep 3 | ### chapter contents 4 | 5 | * [chapter summary](chapter_summary.md) 6 | * [Getting to sleep and staying asleep](Getting_to_sleep_and_staying_asleep.md) 7 | * [sleep terminology](sleep_terminology.md) 8 | * [why sleep](why_sleep.md) 9 | -------------------------------------------------------------------------------- /7z/Create_Password_Protected_Zip_File_with_7z.md: -------------------------------------------------------------------------------- 1 | # Create a password protected zip file with 7z 2 | 3 | I created a new zip called example1.zip, containing a bunch of txt files, and all password protected with the password PASSWORD 4 | 5 | 7z -pPASSWORD a example1.zip *.txt 6 | 7 | -------------------------------------------------------------------------------- /pdf/html_to_pdf.md: -------------------------------------------------------------------------------- 1 | # Html to PDF 2 | 3 | There are plenty of free sites online for converting html to pdf. 4 | 5 | e.g. 6 | 7 | * 8 | 9 | On linux (or windows subsystem for linux) you can use: 10 | 11 | * [wkhtmltopdf](/linux/wkhtmltopdf.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /powershell/Width_of_the_Console.md: -------------------------------------------------------------------------------- 1 | # Determine the width of the console 2 | 3 | To determine the width of the console in powershell: 4 | 5 | $Host.UI.RawUI.WindowSize.Width 6 | 7 | To determine the height of the console in powershell: 8 | 9 | $Host.UI.RawUI.WindowSize.Height 10 | -------------------------------------------------------------------------------- /.net/parse_exact.md: -------------------------------------------------------------------------------- 1 | # ParseExact (and TryParseExact) 2 | 3 | I never remember the parameters for these methods, so here they are: 4 | 5 | 6 | DateTime.TryParseExact(userInput, "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out birthday) -------------------------------------------------------------------------------- /excel/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # excel 3 | ### chapter contents 4 | 5 | * [extract year and month from date for grouping purposes](extract_year_and_month_from_date_for_grouping_purposes.md) 6 | * [if error](if_error.md) 7 | * [subtotal function num](subtotal_function_num.md) 8 | * [VLOOKUP](VLOOKUP.md) 9 | -------------------------------------------------------------------------------- /sql_spatial/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # sql spatial 3 | ### chapter contents 4 | 5 | * [construct line geo from two points](construct_line_geo_from_two_points.md) 6 | * [getfieldtype returned null](getfieldtype_returned_null.md) 7 | * [spatial index temp table trick](spatial_index_temp_table_trick.md) 8 | -------------------------------------------------------------------------------- /asp.net_mvc/select_multi_dropdowns.md: -------------------------------------------------------------------------------- 1 | # How to add multi-select dropdowns to a basic asp.net MVC site? 2 | 3 | First, see [Need to add selects/dropdowns to a basic asp.net MVC site?](select_dropdowns.md) for instructions on installing select2 (and choosing it over chosen) and setting up css etc. 4 | 5 | -------------------------------------------------------------------------------- /inkscape/font_not_showing.md: -------------------------------------------------------------------------------- 1 | # Installed fonts not showing in inkscape 2 | 3 | Custom fonts that I'd downloaded and installed (in windows 10) were not showing in Inkscape (not available as font to select) 4 | 5 | Right-click the font file and choose: 6 | 7 | > Install for all users 8 | 9 | Problem fixed. -------------------------------------------------------------------------------- /chocolatey/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # chocolatey 3 | ### chapter contents 4 | 5 | * [api key](api_key.md) 6 | * [commands](commands.md) 7 | * [install chocolatey](install_chocolatey.md) 8 | * [list localonly](list_localonly.md) 9 | * [specify checksum for chocolatey](specify_checksum_for_chocolatey.md) 10 | -------------------------------------------------------------------------------- /git/diff.md: -------------------------------------------------------------------------------- 1 | # diff of staged files 2 | 3 | You've committed locally (i.e. staged some changes) but haven't yet pushed your changes. 4 | 5 | You are then dismayed because `git diff` returns NOTHING. 6 | 7 | So use: 8 | 9 | git diff --cached 10 | 11 | To see the changes that are staged. 12 | -------------------------------------------------------------------------------- /reading_notes/Kawasaki_AOS.md: -------------------------------------------------------------------------------- 1 | # Art of the start 2 | 3 | 4 | 5 | Pitch the idea to your boss. 6 | 7 | When they reject it go do it yourself. 8 | 9 | Form a Delaware C company 10 | 11 | 12 | 13 | Venn 3: 14 | 15 | Expertise 16 | 17 | Opportunity 18 | 19 | Passion 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /marketing/influencer.md: -------------------------------------------------------------------------------- 1 | # Influencer marketing 2 | 3 | 4 | 5 | ## Swag Bombs 6 | 7 | * 8 | 9 | ## Cold Tweeting 10 | 11 | * 12 | 13 | ## Outreach email 14 | 15 | * Example templates 16 | 17 | -------------------------------------------------------------------------------- /sql_server_reporting_services/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # sql server reporting services 3 | ### chapter contents 4 | 5 | * [alternating row colors inside groups](alternating_row_colors_inside_groups.md) 6 | * [reports are blank in chrome](reports_are_blank_in_chrome.md) 7 | * [view report data](view_report_data.md) 8 | -------------------------------------------------------------------------------- /linux/mkdir_recursive_force.md: -------------------------------------------------------------------------------- 1 | # mkdir recursive/force 2 | 3 | If you want to make directories in linux and *force* it to recursively make parent directories as needed, use: 4 | 5 | $ mkdir -p foo/bar/baz/lur/man 6 | 7 | ...will make parent directories as needed. 8 | 9 | ## Source 10 | 11 | * `man mkdir` -------------------------------------------------------------------------------- /powershell/here_strings.md: -------------------------------------------------------------------------------- 1 | # Here Strings 2 | 3 | I never remember the syntax for a here-string. "Here" it is. Pun most definitely intended my padre. 4 | 5 | $myVariable = @" 6 | This is inside a here string. 7 | Remember to put back ticks before dollar signs. 8 | That'll be `$5. 9 | "@ 10 | -------------------------------------------------------------------------------- /python/input_output.md: -------------------------------------------------------------------------------- 1 | # simple input and output in python interactive 2 | 3 | >>> message = "hello world" 4 | >>> print(message) 5 | hello world 6 | >>> message = raw_input() 7 | (I types...) HELLO WORLD 8 | >>> print(message) 9 | HELLO WORLD 10 | >>> 11 | 12 | 13 | -------------------------------------------------------------------------------- /.ok: -------------------------------------------------------------------------------- 1 | .\quick.ps1; .\deploy.ps1; set-clipboard '.\deploy.ps1 "'; get-clipboard # quick-build, prepare to deploy 2 | .\build.ps1 # complete build, after which you can see preview 3 | n _book\index.html # see preview 4 | .\wordcount.ps1 # custom word count script 5 | bash; # see C:\Users\Leon\AppData\Local\lxss\home\leon\til\_book 6 | -------------------------------------------------------------------------------- /git/see_git_folder.md: -------------------------------------------------------------------------------- 1 | # See the .git folder (in a terminal) 2 | 3 | The ".git" folder is hidden by default. 4 | 5 | use: 6 | 7 | Get-ChildItem -force 8 | 9 | To see hidden folders. 10 | 11 | (On linux, files/folders starting with "." are hidden from `ls`, and you use `-a` or `--all` to view them.) 12 | 13 | -------------------------------------------------------------------------------- /.net/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # .net 3 | ### chapter contents 4 | 5 | * [config external source](config_external_source.md) 6 | * [detect text encoding](detect_text_encoding.md) 7 | * [load datatable](load_datatable.md) 8 | * [override equals](override_equals.md) 9 | * [parse exact](parse_exact.md) 10 | * [zipfile](zipfile.md) 11 | -------------------------------------------------------------------------------- /css/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # css 3 | ### chapter contents 4 | 5 | * [center](center.md) 6 | * [detect retina high dpi display](detect_retina_high_dpi_display.md) 7 | * [glyph after blank anchors](glyph_after_blank_anchors.md) 8 | * [maintainable css](maintainable_css.md) 9 | * [refactoring ui tools](refactoring_ui_tools.md) 10 | -------------------------------------------------------------------------------- /mercurial/orig_files.md: -------------------------------------------------------------------------------- 1 | # Got a bunch of .orig files you don't want? 2 | 3 | use powershell to recursively delete all the .orig files created by mercurial after reverting (i.e. abandoning) a change. 4 | 5 | dir . *.orig -recurse | del 6 | 7 | i.e. after a "hg revert --all" or a merge gone horribly right. 8 | 9 | 10 | -------------------------------------------------------------------------------- /sql_server/Create_Schema_Authorization.md: -------------------------------------------------------------------------------- 1 | # Create Schema with Authorization 2 | 3 | When Creating schemas, if you don't specify the 'Authorization' then the 'owner' of the schema will be the user who ran the script. 4 | 5 | So specify `DBO` for example, with a script like this: 6 | 7 | CREATE SCHEMA [BUSINESS] Authorization DBO 8 | -------------------------------------------------------------------------------- /oracle/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # oracle 3 | ### chapter contents 4 | 5 | * [connection strings](connection_strings.md) 6 | * [date literal](date_literal.md) 7 | * [get text of view](get_text_of_view.md) 8 | * [instant client](instant_client.md) 9 | * [top 10](top_10.md) 10 | * [what version of oracle](what_version_of_oracle.md) 11 | -------------------------------------------------------------------------------- /oracle/top_10.md: -------------------------------------------------------------------------------- 1 | # Select top (10) in oracle 2 | 3 | SELECT * FROM ( 4 | ... Your query here... SELECT FROM WHERE 5 | ) 6 | WHERE ROWNUM <= 10 7 | 8 | 9 | And, although it's offtopic, let me add that in mysql you use LIMIT, e.g. 10 | 11 | SELECT * 12 | FROM Persons 13 | LIMIT 5; 14 | 15 | -------------------------------------------------------------------------------- /powershell/repeat_every_n_seconds_forever: -------------------------------------------------------------------------------- 1 | # Repeat every n seconds forever 2 | 3 | I wanted to repeat this every 5 seconds: 4 | 5 | dir . *.* -recurse | measure | % Count 6 | 7 | 8 | And used this command to achieve it: 9 | 10 | cls; while ($true) { dir . *.* -recurse | measure | % Count; start-sleep -seconds 5; } -------------------------------------------------------------------------------- /oracle/get_text_of_view.md: -------------------------------------------------------------------------------- 1 | # Get text of a view from Oracle 2 | 3 | 4 | There are no doubt other ways to get this, but what I've used is: 5 | 6 | 7 | select TEXT 8 | FROM DBA_VIEWS 9 | where OWNER = 'THE_OWNER' and VIEW_NAME = 'THE_VIEW' 10 | 11 | ...and you'll need to substitute the correct owner name and view name. -------------------------------------------------------------------------------- /visual_studio/nuget_json_dot_net_problem.md: -------------------------------------------------------------------------------- 1 | # Adding Nuget reference to Json.net errored with "'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp' in Visual Studio 2010 2 | 3 | 4 | Solution was to run this... 5 | 6 | Install-Package Newtonsoft.Json -Version 8.0.3 7 | 8 | No online help was very helpful. 9 | 10 | -------------------------------------------------------------------------------- /javascript/random_item.md: -------------------------------------------------------------------------------- 1 | # Retrieve a random item from an array 2 | 3 | Since `Math.random()` returns a random number from `0` to `1`, returning a random item from an array is as easy as: 4 | 5 | 6 | var items = ['hat', 'puzzle', 'cobra', 'window', 'tooth', 'zebra']; 7 | 8 | var randomItem = items[Math.floor(Math.random() * items.length)]; 9 | -------------------------------------------------------------------------------- /windows.forms/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # windows.forms 3 | ### chapter contents 4 | 5 | * [custom toolstrip renderer](custom_toolstrip_renderer.md) 6 | * [DPI aware winforms](DPI_aware_winforms.md) 7 | * [key down](key_down.md) 8 | * [reduce flicker](reduce_flicker.md) 9 | * [select all](select_all.md) 10 | * [using dark theme](using_dark_theme.md) 11 | -------------------------------------------------------------------------------- /notepad++/trim_trailing_and_save.md: -------------------------------------------------------------------------------- 1 | # Trim trailing and save 2 | 3 | notepad++ is a shocker at putting trailing whitespace on files. 4 | 5 | keystroke: 6 | 7 | alt+shift+s 8 | 9 | will trim trailing whitespace and save. 10 | 11 | some people recommend re-mapping ctrl-s to trim trailing whitespace and save. i haven't gone that far yet. 12 | 13 | -------------------------------------------------------------------------------- /linux/nano.md: -------------------------------------------------------------------------------- 1 | # nano 2 | 3 | Common shortcut keys which are worth committing to finger memory are: 4 | 5 | Ctrl O - Write Out. 6 | Ctrl X - Exit 7 | 8 | But here's the one I want to remember... 9 | 10 | Ctrl K -- delete current line 11 | 12 | ## See also 13 | 14 | * [bg,fg: background and foreground](bg_fg_background_and_foreground.md) -------------------------------------------------------------------------------- /npm/List_Globally_Installed_npm_Packages.md: -------------------------------------------------------------------------------- 1 | # How do I list all globally installed NPM Packages? 2 | 3 | 4 | 5 | npm list -g -depth 0 6 | 7 | The above lists all the globally installed npm packages, and does not list their dependencies. 8 | 9 | Omit the "depth 0" bit and you'll also see the full ugly rat's nest of dependencies they've wrought upon your hard ware. -------------------------------------------------------------------------------- /npm/nodejs_on_ubuntu_linux.md: -------------------------------------------------------------------------------- 1 | # nodejs on ubuntu linux 2 | 3 | 4 | >I've found this is often a misnaming error, if you install from a package manager you bin may be called nodejs so you just need to symlink it like so 5 | 6 | ln -s /usr/bin/nodejs /usr/bin/node 7 | 8 | 9 | ## source 10 | 11 | * https://github.com/nodejs/node-v0.x-archive/issues/3911 -------------------------------------------------------------------------------- /python/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # python 3 | ### chapter contents 4 | 5 | * [blocks in minecraft](blocks_in_minecraft.md) 6 | * [comments](comments.md) 7 | * [entities in minecraft](entities_in_minecraft.md) 8 | * [grip](grip.md) 9 | * [input output](input_output.md) 10 | * [pip](pip.md) 11 | * [python in minecraft](python_in_minecraft.md) 12 | * [turtle](turtle.md) 13 | -------------------------------------------------------------------------------- /web/instant_websites.md: -------------------------------------------------------------------------------- 1 | # Instant Websites 2 | 3 | Tools/Resources for instantly building a business website (or APP) 4 | 5 | * https://sourceryapp.com/ 6 | * https://milkshake.app 7 | * https://onuniverse.com/ 8 | * https://www.glideapps.com/ (spreadsheet -> app) 9 | * https://carrd.co/ 10 | * https://about.me/LeonBambrick 11 | * http://contactup.io/_u30629/ 12 | -------------------------------------------------------------------------------- /graphics/sankey.md: -------------------------------------------------------------------------------- 1 | # Sankey diagrams 2 | 3 | To remember the name of sankey diagrams I just think "snakey" and then rearrange the letters a bit. 4 | 5 | And dat's my tip o the day! 6 | 7 | To build sankey diagrams my weapon of choice is: 8 | 9 | Here is a very simple example: 10 | 11 | http://sankeymatic.com/build/ 12 | 13 | ![sankey matic example](sankeymatic.png) -------------------------------------------------------------------------------- /vs_code/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # vs code 3 | ### chapter contents 4 | 5 | * [hiding noise](hiding_noise.md) 6 | * [keystrokes expand collapse](keystrokes_expand_collapse.md) 7 | * [launch vs code](launch_vs_code.md) 8 | * [markdown preview](markdown_preview.md) 9 | * [navigate back](navigate_back.md) 10 | * [remove trailing whitespace](remove_trailing_whitespace.md) 11 | -------------------------------------------------------------------------------- /python/pip.md: -------------------------------------------------------------------------------- 1 | # PIP: Pip installs Packages 2 | 3 | Pip is a package manager that comes bundled with Python (since version 2.7.9, and since 3.4) 4 | 5 | You can use it to install things: 6 | 7 | e.g. 8 | 9 | pip install grip 10 | 11 | Here's a very easy to follow guide to using pip on windows: 12 | 13 | -------------------------------------------------------------------------------- /powershell/find_all_fonts.md: -------------------------------------------------------------------------------- 1 | # Find all fonts on your machine 2 | 3 | [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") 4 | (New-Object System.Drawing.Text.InstalledFontCollection).Families 5 | 6 | Or -- visit this URL: 7 | 8 | http://pomax.nihongoresources.com/downloads/fonttest/ 9 | 10 | Which detects all fonts on your computer using a neat trick. 11 | 12 | -------------------------------------------------------------------------------- /cover.txt: -------------------------------------------------------------------------------- 1 | . . . 2 | _=**=_ 3 | ...*(( )).. . . 4 | .. ..**((( TODAY I ))).**.... 5 | ...!(( LEARNED )!*.. . 6 | .. !(( )!! .. 7 | ---===** ** ==--- 8 | . ^^^^ ^^ . 9 | . . . 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /linux/version.md: -------------------------------------------------------------------------------- 1 | # What version of ubuntu am i running? 2 | 3 | Use the command `lsb_release -a` 4 | 5 | $ lsb_release -a 6 | No LSB modules are available. 7 | Distributor ID: Ubuntu 8 | Description: Ubuntu 16.04.6 LTS 9 | Release: 16.04 10 | Codename: xenial 11 | 12 | 13 | 14 | ## Source 15 | 16 | * -------------------------------------------------------------------------------- /zoho/catch_all.md: -------------------------------------------------------------------------------- 1 | # Catch all email address at Zoho 2 | 3 | I decided to set one of these up. 4 | 5 | Control Panel > Mail Administration > Org Settings 6 | 7 | "Catch all" tab. 8 | 9 | I had to create the account first. 10 | 11 | In the "Catch all address" you put the complete email address including the domain (even though you've specified the domain in a drop down above) 12 | 13 | -------------------------------------------------------------------------------- /git/git_bitbucket.md: -------------------------------------------------------------------------------- 1 | # When creating a new git repo on bitbucket 2 | 3 | 4 | (go into the folder that you want to be the repository) 5 | 6 | git init 7 | git remote add origin https://secretgeek@bitbucket.org/secretgeek/test_appharbor.git 8 | "# Hello" > readme.md 9 | git add * 10 | git commit . -m "funny comment" 11 | git push --set-upstream origin master 12 | 13 | -------------------------------------------------------------------------------- /google/post_to_google_sheets.md: -------------------------------------------------------------------------------- 1 | ## Post to google sheets from javascript 2 | 3 | Okay - you can use google forms to write to google sheets, that's great but it gives you no ability to really customize the form: the style, size and the user experience. 4 | 5 | I've found these great examples of how it's done... 6 | 7 | See [capture email](.\capture-email.html) for a live example. 8 | 9 | 10 | -------------------------------------------------------------------------------- /macbook_air/print_screen.md: -------------------------------------------------------------------------------- 1 | # How to press the Print Screen key on a MacBook Air (running Windows) 2 | 3 | On a MacBook Air running windows: 4 | printscreen: [fn] + [shift] + [f11] 5 | Hence: alt + printscreen == [fn] + [alt] + [shift] + [F11] 6 | 7 | 8 | 9 | ## Source 10 | 11 | * -------------------------------------------------------------------------------- /reading_notes/Pirsig_Motorcycle.md: -------------------------------------------------------------------------------- 1 | # Zen and the Art of motorcycle Maintenance 2 | 3 | U can mix story with lecture. 4 | 5 | We did this and I am reminded that. No real link between them. 6 | 7 | Include suspense though (across the story parts "at moment, Chris has noticed something.", and/or across the lecture sections... "tomorrow we'll see more about that..."). 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /windows/when_does_password_expire.md: -------------------------------------------------------------------------------- 1 | # When does your windows account's password expire? 2 | 3 | The command to see this info is: 4 | 5 | net user {userName} /DOMAIN 6 | 7 | Where "{userName}" is your username. 8 | 9 | I misread this and thought that /DOMAIN should be /{DOMAIN NAME} ... which led to an "access is denied" message. /DOMAIN is literally "/DOMAIN" 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /powershell/date_format.md: -------------------------------------------------------------------------------- 1 | # date format in powershell 2 | 3 | Simple! 4 | 5 | get-date -f "yyyy-MM-dd HH:mm:ss" 6 | 7 | or... 8 | 9 | (get-date).ToString("yyyy-MM-dd") 10 | 11 | or better (worse) yet 12 | 13 | [system.string]::format("{0:yyyy-mm-dd}", (get-date)) 14 | 15 | 16 | Formatting a list of dates... 17 | 18 | dir *.txt | % { $_.LastWriteTime.ToString("yyyy-MM-dd") } 19 | -------------------------------------------------------------------------------- /excel/extract_year_and_month_from_date_for_grouping_purposes.md: -------------------------------------------------------------------------------- 1 | # Extract Year/Month (for grouping/reporting) 2 | 3 | In Excel when you want one column to contain the year-month (for grouping purposes) -- here is the formula 4 | 5 | =TEXT(A2,"yyyy-mm") 6 | 7 | That text formula sure looks handy. 8 | 9 | If you don't know about pivot tables, then you should. Pivot tables are worth your time. 10 | -------------------------------------------------------------------------------- /powershell/find_headings_in_markdown: -------------------------------------------------------------------------------- 1 | # Find headings in markdown... 2 | 3 | To list the headings from a markdown document 4 | 5 | cat .\20_Find_Your_Product.md | select-string -pattern "^( )*#.*" 6 | 7 | (Assuming it's pure markdown, no mixed in html) 8 | 9 | And the common alias for `select-string` is `sls`, so for brevity: 10 | 11 | cat .\20_Find_Your_Product.md | sls "^( )*#.*" 12 | 13 | 14 | -------------------------------------------------------------------------------- /sql_server/convert_hex_varchar_to_bigint.md: -------------------------------------------------------------------------------- 1 | # How do I Convert a Hex varchar to a Bigint in SQL Server? (solved) 2 | 3 | 4 | 5 | Given a string such as 6 | 7 | > 0x00000000007240EE 8 | 9 | How do I turn it into an integer? (a bigint in fact)? 10 | 11 | Answer: 12 | 13 | 14 | select convert(bigint, convert (varbinary(8), '0x00000000007240EE', 1)) 15 | 16 | Result: 17 | 18 | 7487726 19 | 20 | -------------------------------------------------------------------------------- /powershell/call_commandline_apps.md: -------------------------------------------------------------------------------- 1 | # How to call command line apps like a powershell pro.... 2 | 3 | Call command line apps via powershell like this: 4 | 5 | $arguments = @("/i", $msiInstallPath, "/L* $msiInstallPath.log", "/qn", "/norestart") 6 | $process = Start-Process -FilePath "msiexec.exe" -ArgumentList $arguments -Wait -PassThru 7 | 8 | That's how the professional do it. And so should you. Allegedly. -------------------------------------------------------------------------------- /powershell/find_headings_in_markdown.md: -------------------------------------------------------------------------------- 1 | # Find headings in markdown... 2 | 3 | To list the headings from a markdown document 4 | 5 | cat .\20_Find_Your_Product.md | select-string -pattern "^( )*#.*" 6 | 7 | (Assuming it's pure markdown, no mixed in html) 8 | 9 | And the common alias for `select-string` is `sls`, so for brevity: 10 | 11 | cat .\20_Find_Your_Product.md | sls "^( )*#.*" 12 | 13 | 14 | -------------------------------------------------------------------------------- /http/trace.md: -------------------------------------------------------------------------------- 1 | # How to perform an HTTP trace 2 | 3 | 4 | * Chrome plugin, [http watch](http://www.httpwatch.com/download/) 5 | * [Fiddler](https://www.telerik.com/download/fiddler) 6 | * Developer tools, network tab 7 | * Wireshark 8 | 9 | ## Source 10 | 11 | * [How to take an HTTP trace from the client](https://techcommunity.microsoft.com/t5/IIS-Support-Blog/How-to-take-an-HTTP-trace-from-the-client/ba-p/799618) -------------------------------------------------------------------------------- /npm/node_gyp_dependencies.md: -------------------------------------------------------------------------------- 1 | # node-gyp is much used by npm, but its dependencies need to be manually installed 2 | 3 | > Some npm plugins need node-gyp to be installed. 4 | >However, node-gyp has it's own dependencies ([from the github page](https://github.com/TooTallNate/node-gyp)) 5 | >
—http://stackoverflow.com/a/21366601/49 6 | 7 | 8 | Try this first: 9 | 10 | npm install -g node-gyp 11 | -------------------------------------------------------------------------------- /powershell/format_table_with_expressions.md: -------------------------------------------------------------------------------- 1 | # Format-Table with Expressions. This is a custom Get-ChildItem command, for use with the TIL folder. But it also demonstrates use of Format-Table with expressions. dir . *.md -recurse | format-table @{Expression={$_.Name};Label="Name";width=50},@{Expression={$_.DirectoryName.Split("\")[-1]};Label="Topic";width=25} I've added it to my profile as function ls1. -------------------------------------------------------------------------------- /twitter/Stop_Automatic_Conversion_To_URLs.md: -------------------------------------------------------------------------------- 1 | # Stop Twitter form Automatically parsing URLs 2 | 3 | 4 | To prevent twitter from automatically parsing URLs? Use the Character 2024, ONE DOT LEADER, instead of the regular dot 5 | 6 | 7 | Thanks to [@Igal](https://twitter.com/hmemcpy/status/1151108617191530497) 8 | 9 | (The classic example of this problem is when someone mentions asp.net) 10 | 11 | ․ 12 | 13 | -------------------------------------------------------------------------------- /mercurial/waiting_for_lock.md: -------------------------------------------------------------------------------- 1 | # "waiting for lock on working directory held by" (me) 2 | 3 | 4 | 5 | > Delete the repository file: .hg/store/lock or may be in .hg/wlock 6 | 7 | > When deleting the lock file, you must make sure nothing else is accessing the repository. 8 | 9 | 10 | ## Source 11 | 12 | * [Mercurial stuck "waiting for lock"](https://stackoverflow.com/questions/12865/mercurial-stuck-waiting-for-lock) -------------------------------------------------------------------------------- /powershell/how_to_find_free_space_on_C_drive.md: -------------------------------------------------------------------------------- 1 | # How to find how much free space is left on a drive 2 | 3 | 4 | In short: 5 | 6 | get-psdrive C 7 | 8 | Bit lengthier... 9 | 10 | get-psdrive C | % { "" + $_.Used/1GB + " GB used, " + $_.Free/1GB + " GB free"} 11 | 12 | Or lengthier still: 13 | 14 | get-psdrive C | % { "" + "{0:0.00}" -f ($_.Used/1GB) + " GB used, " + "{0:0.00}" -f ($_.Free/1GB) + " GB free"} -------------------------------------------------------------------------------- /sql_server/generate_change_script.md: -------------------------------------------------------------------------------- 1 | # Generate Change Script 2 | 3 | I can never find this icon since it changed appearance... 4 | 5 | Here's the "Generate Change Script" on the "Table Designer" toolstrip of "Microsoft Sql Server Management Studio v17.8.1" 6 | 7 | ![generate change script](generate-change-script.png) 8 | 9 | 10 | 11 | You can also get to this function from the "Table Designer" menu, last option. -------------------------------------------------------------------------------- /vs_code/navigate_back.md: -------------------------------------------------------------------------------- 1 | # How to navigate back in Visual Studio Code 2 | 3 | In visual studio I use `Ctrl Minus` to move back to my previous location. And in Powershell I use `popd`. 4 | 5 | in vs code I use: `Alt left-arrow` to go back to my previous location. 6 | 7 | And `Alt right-arrow` to return to forward location. 8 | 9 | 10 | ## See also 11 | 12 | * [Notepad++: Navigate back](..\notepad++\navigate_back.md) -------------------------------------------------------------------------------- /.net_core_MVC/view_imports.md: -------------------------------------------------------------------------------- 1 | # View Imports file 2 | 3 | Behold the wonders of "_ViewImports.cshtml" 4 | 5 | This file is located in the views folder. 6 | 7 | It contains such wise utterances as these: 8 | 9 | @using MyProject.Model 10 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 11 | 12 | And thus, by adding `@usings` to't, you can avoid the need for peppering your views with more usings. 13 | -------------------------------------------------------------------------------- /memorize/memory_techniques.md: -------------------------------------------------------------------------------- 1 | # Memory Techniques 2 | 3 | * Drawing has huge boost over writing: https://digest.bps.org.uk/2018/11/22/the-act-of-drawing-something-has-a-massive-benefit-for-memory-compared-with-writing-it-down/ 4 | * Social Encoding advantage: teaching to a friend improves your memory. 5 | * Curiosity advantage 6 | * Story encoding 7 | * Sleep for memory enhancement 8 | * Palace of the mind 9 | * Spaced repetition -------------------------------------------------------------------------------- /python/comments.md: -------------------------------------------------------------------------------- 1 | # Comments in python 2 | 3 | Single line: 4 | 5 | # this line is commented out 6 | height = 3 # this is a comment 7 | 8 | And block comments: 9 | 10 | 11 | ''' 12 | comments.md 13 | Purpose: Describe comments in python 14 | This is a multiline doc comment. 15 | ''' 16 | 17 | ...Those are called docstrings, and you include them at the start of modules and functions. -------------------------------------------------------------------------------- /sql_server/sp_heltpext.md: -------------------------------------------------------------------------------- 1 | # Sick of typing sp_heltpext ? 2 | 3 | 4 | Create a function `sp_heltpext` which channels the parameter to `sp_helptext` 5 | 6 | Alter Procedure sp_heltpext (@Sprocname varchar(500)) 7 | AS 8 | BEGIN 9 | print 'Assuming you meant:' 10 | print 'sp_helptext ' + '''' + @sprocname + '''' 11 | print '' 12 | exec sp_helptext @sprocname 13 | END 14 | 15 | -------------------------------------------------------------------------------- /bower/update_bower.md: -------------------------------------------------------------------------------- 1 | # update bower 2 | 3 | To update `bower` one simply has to... 4 | 5 | npm i -g bower 6 | 7 | where: 8 | 9 | * `i` is for install and 10 | * `g` is for global 11 | 12 | 13 | output like: 14 | 15 | 16 | C:\Users\UserName\AppData\Roaming\npm\bower -> C:\Users\UserName\AppData\Roaming\npm\node_modules\bower\bin\bower 17 | C:\Users\UserName\AppData\Roaming\npm 18 | +-- bower@1.8.0 -------------------------------------------------------------------------------- /iis/which_version.md: -------------------------------------------------------------------------------- 1 | ## Which version 2 | 3 | You can open the Internet information Services (IIS) Manager, and go to Help | About. 4 | 5 | Or run this in powershell: 6 | 7 | get-itemproperty HKLM:\SOFTWARE\Microsoft\InetStp\ | select setupstring,versionstring 8 | 9 | ## Source 10 | 11 | * [Finding Version of IIS using powershell](http://stackoverflow.com/questions/16784587/finding-version-of-iis-using-powershell) -------------------------------------------------------------------------------- /gitbook/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # gitbook 3 | ### chapter contents 4 | 5 | * [add google analytics to gitbook](add_google_analytics_to_gitbook.md) 6 | * [cover image](cover_image.md) 7 | * [custom css](custom_css.md) 8 | * [getting started with gitbook](getting_started_with_gitbook.md) 9 | * [host on custom subdomain](host_on_custom_subdomain.md) 10 | * [use gitbook locally](use_gitbook_locally.md) 11 | * [web hooks](web_hooks.md) 12 | -------------------------------------------------------------------------------- /linux/delete_files_older_than_90_days.md: -------------------------------------------------------------------------------- 1 | # Delete files older than 90 days 2 | 3 | First, list files older than 90 days... 4 | 5 | find . -mtime +90 -type f 6 | 7 | (note, could specify a specific/absolute folder instead of "." for current folder) 8 | 9 | Note `-type f` means "files" 10 | 11 | Happy with the result? Add a `-delete` parameter to delete those files. So long, files! 12 | 13 | find . -mtime +90 -type f -delete 14 | -------------------------------------------------------------------------------- /reading_notes/Frankl_Meaning.md: -------------------------------------------------------------------------------- 1 | # Victor Frankl Man's Search for Meaning 2 | 3 | 4 | 5 | Paradoxical intention- to overcoming stuttering try and stutter all you can 6 | 7 | Similar to ACT techniques 8 | 9 | 10 | 11 | Meaning found via: 12 | 13 | Works and deed 14 | By experience of Love (human relations) 15 | By turning tragedy into triumph - by being proud of suffering (not chosen suffering: unavoidable suffering) 16 | 17 | -------------------------------------------------------------------------------- /windows/mstsc_without_mouse.md: -------------------------------------------------------------------------------- 1 | # Terminal services client, without a mouse 2 | 3 | If you're in a terminal services client and do not have a working mouse... 4 | 5 | To get to the "Connection Bar" type `CTRL+ALT+HOME` 6 | 7 | 8 | To send the equivalent of a `CTRL+ALT+DEL` use `CTRL+ALT+END` 9 | 10 | 11 | ## Source 12 | 13 | * [Remote Desktop Services Shortcut Keys](https://msdn.microsoft.com/en-us/library/aa383500(v=vs.85).aspx) -------------------------------------------------------------------------------- /.net_core_MVC/documenting_asp_net_core.md: -------------------------------------------------------------------------------- 1 | # Where/How to document asp.net core 2 | 3 | 4 | * Documentation at microsoft: 5 | 6 | 7 | * Source of that documentation at github 8 | 9 | 10 | * Documentation at stack overflow: 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /sharepoint/find_view_guid.md: -------------------------------------------------------------------------------- 1 | # Find view guid 2 | 3 | It can be hard to find the guid of a list, if you don't have many permissions (I have very little permissions in this list) 4 | 5 | But if you export a list to Excel: 6 | 7 | ![export_to_excel](export_to_excel.png) 8 | 9 | It will embed the guid in the data connection properties 10 | 11 | ![find_view_guid.png](find_view_guid.png) 12 | 13 | Bit convoluted, but there it is. 14 | 15 | -------------------------------------------------------------------------------- /concepts/mere_exposure.md: -------------------------------------------------------------------------------- 1 | # Mere Exposure 2 | 3 | If you see something often enough you begin to think it is as it should be. 4 | 5 | Even if you've only seen something one time, you think it's better than a thing you've seen zero times. 6 | 7 | Example. If you put Donald Trump on reality TV in US living rooms every week, next thing he'll end up being nominated as a Presidential candidate. 8 | 9 | You need to be very careful about what you are exposed to. -------------------------------------------------------------------------------- /security_virus_spam_etc/google_search_console.md: -------------------------------------------------------------------------------- 1 | #Is your website flagged as containing malware? 2 | 3 | 4 | google search console (formerly google webmaster tools) tells you if there's any spam/malware on your sites. 5 | 6 | for example i received this warning: 7 | 8 | Hacked content detected on http://timesnapper.com/ 9 | 10 | found the problem, found the cause, fixed it, wrote to google and they stopped penalizing my site. 11 | 12 | 13 | -------------------------------------------------------------------------------- /visual_studio/tabs_and_spaces.md: -------------------------------------------------------------------------------- 1 | # Tabs versus Spaces 2 | 3 | Make whitespace visible: Edit | Advanced | View whitespace 4 | 5 | Use 'Productivity Power Tools' to find inconsistent tabs/spaces. 6 | 7 | Note, with 'Productivity Power Tools', turn off the crazy tab coloring by going to 8 | 9 | Tools | 10 | Options | 11 | Productivity Power Tools | 12 | Custom Document Well | 13 | And Uncheck "Color tabs by project" 14 | 15 | 16 | -------------------------------------------------------------------------------- /google/chrome_reopen_closed_tabs.md: -------------------------------------------------------------------------------- 1 | # Reopen closed tabs in google chrome 2 | 3 | Key-combination: 4 | 5 | Ctrl + Shift + T 6 | 7 | 8 | Or right click on a tab (any tab) and select "Reopen closed tab". If you right click on that item multiple times it will reopen them in the order in which they were closed. 9 | 10 | 11 | # Source 12 | 13 | * http://www.nirmaltv.com/2016/02/02/restore-recover-closed-tab-google-chrome-firefox-opera-microsoft-edge/ -------------------------------------------------------------------------------- /javascript/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # javascript 3 | ### chapter contents 4 | 5 | * [add remove class](add_remove_class.md) 6 | * [console error](console_error.md) 7 | * [copy element to clipboard](copy_element_to_clipboard.md) 8 | * [eval](eval.md) 9 | * [generate guid](generate_guid.md) 10 | * [iife](iife.md) 11 | * [in 2019](in_2019.md) 12 | * [poor mans jquery](poor_mans_jquery.md) 13 | * [quickstart](quickstart.md) 14 | * [random item](random_item.md) 15 | -------------------------------------------------------------------------------- /gitbook/custom_css.md: -------------------------------------------------------------------------------- 1 | # Custom CSS 2 | 3 | > You can specify CSS files to be included in your book's website or PDF builds by creating files: 4 | > 5 | > * styles/website.css: will apply only to the website 6 | > * styles/pdf.css: will apply only to the PDF 7 | > * styles/ebook.css: will apply only to ebook formats (PDF, Mobi, ePub) 8 | 9 | 10 | ## Source 11 | 12 | * [How can I include custom CSS?](https://help.gitbook.com/content/how-can-i-include-css.html) -------------------------------------------------------------------------------- /powershell/is_current_user_admin.md: -------------------------------------------------------------------------------- 1 | # To test if the current user is an admin 2 | 3 | Is the current user an administrator? 4 | 5 | I inherited (from Rhys) this mini function for finding out: 6 | 7 | function Test-Administrator 8 | { 9 | $user = [Security.Principal.WindowsIdentity]::GetCurrent(); 10 | (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) 11 | } 12 | -------------------------------------------------------------------------------- /iis/where_to_find_the_logs_for_a_site.md: -------------------------------------------------------------------------------- 1 | # Where to find the logs for a site? 2 | 3 | If you click on the "Sites" node in IIS manager, you'll see summary info for all sites at once. One column is an ID for each app. Hold onto that ID, e.g. "8" 4 | 5 | Then look in the "Logging" module for the site you're interested. You'll see a directory such as "%SystemDrive%\inetpub\logs\LogFiles" 6 | 7 | If the ID is "8" that means its logs are in "C:\inetpub\logs\LogFiles\w3svc8" 8 | 9 | -------------------------------------------------------------------------------- /pdf/markdown_to_pdf.md: -------------------------------------------------------------------------------- 1 | # Markdown to PDF 2 | 3 | to convert markdown to PDF... I made a tool for that: 4 | 5 | * [PDF.NimbleText.com](https://pdf.nimbletext.com) 6 | 7 | It lets you choose different themes as well. 8 | 9 | The conversion from html to pdf is performed by [wkhtmltopdf](https://github.com/wkhtmltopdf/wkhtmltopdf) 10 | 11 | And it uses stylesheets/themes from [https://github.com/mixu/markdown-styles](https://github.com/mixu/markdown-styles) 12 | 13 | 14 | -------------------------------------------------------------------------------- /npm/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # npm 3 | ### chapter contents 4 | 5 | * [amd](amd.md) 6 | * [getting started](getting_started.md) 7 | * [install npm](install_npm.md) 8 | * [List Globally Installed npm Packages](List_Globally_Installed_npm_Packages.md) 9 | * [nodejs on ubuntu linux](nodejs_on_ubuntu_linux.md) 10 | * [node gyp dependencies](node_gyp_dependencies.md) 11 | * [npm run scripts](npm_run_scripts.md) 12 | * [tab completion with powershell](tab_completion_with_powershell.md) 13 | -------------------------------------------------------------------------------- /saltwater_swimming_pool/checklist.md: -------------------------------------------------------------------------------- 1 | # When Things Go Wrong 2 | 3 | 1. Basic checklist if pool is green, or if chlorine is low. 4 | 2. Basic checklist if water level is dropping 5 | 3. What to do during storms or yard flooding 6 | 7 | 8 | _ is pool green? 9 | _ is pool cloudy? 10 | _ is chlorine present? 11 | _ is chlorinator switched on? 12 | _ is salt present? 13 | _ does salt monitor indicate that charge is moving through chlorinator? 14 | _ check the cell. Is it clean? 15 | 16 | 17 | -------------------------------------------------------------------------------- /concepts/opportunity_cost.md: -------------------------------------------------------------------------------- 1 | # Opportunity Cost 2 | 3 | Often you can't directly work out the cost of a thing itself. 4 | 5 | You can instead work out the value of the best alternative forgone. 6 | 7 | For example, writing "Yet Another Logging Framework" might seem to cost you 1 week. But if it stopped you from writing "The Million Dollar Feature" — then it has an opportunity cost of 1 million dollars. 8 | 9 | ## See Also 10 | 11 | http://lesswrong.com/lw/hhl/useful_concepts_repository/ -------------------------------------------------------------------------------- /css/glyph_after_blank_anchors.md: -------------------------------------------------------------------------------- 1 | # How to show a little arrow glyph after 'target="_blank"' anchors 2 | 3 | What I wanted was a visual indication of which urls would open in a new window. 4 | 5 | I found a pure css solution, that didn't require altering the html at all. 6 | 7 | 8 | a[target="_blank"]:after { 9 | content: " \2197"; 10 | font-size:0.9em; 11 | } 12 | 13 | This means: 14 | 15 | any a element with 'target="_blank"' 16 | should have a small North East arrow after it. 17 | -------------------------------------------------------------------------------- /memorize/phonetic_alphabet.md: -------------------------------------------------------------------------------- 1 | # Phonetic Alphabet 2 | 3 | 4 | 5 | |Letter|Name| 6 | |------|----| 7 | |A|Alfa| 8 | |B|Bravo| 9 | |C|Charlie| 10 | |D|Delta| 11 | |E|Echo| 12 | |F|Foxtrot| 13 | |G|Golf| 14 | |H|Hotel| 15 | |I|India| 16 | |J|Juliett| 17 | |K|Kilo| 18 | |L|Lima| 19 | |M|Mike| 20 | |N|November| 21 | |O|Oscar| 22 | |P|Papa| 23 | |Q|Quebec| 24 | |R|Romeo| 25 | |S|Sierra| 26 | |T|Tango| 27 | |U|Uniform| 28 | |V|Victor| 29 | |W|Whiskey| 30 | |X|X-ray| 31 | |Y|Yankee| 32 | |Z|Zulu| 33 | -------------------------------------------------------------------------------- /google/chrome_design_mode.md: -------------------------------------------------------------------------------- 1 | # Google Chrome: Design Mode = ON let's you edit inline 2 | 3 | F12, dev tools -- then enter this in the console 4 | 5 | document.designMode="on"; 6 | 7 | Now you can type on any element of the webpage and change what it says. 8 | 9 | 10 | You can also create a bookmarklet called 'edit' with this as the URL: 11 | 12 | javascript:document.body.contentEditable='true'; document.designMode='on'; void 0 13 | 14 | ... and click it at any time to make any page easy to edit. -------------------------------------------------------------------------------- /graphics/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # graphics 3 | ### chapter contents 4 | 5 | * [ascii fonts](ascii_fonts.md) 6 | * [bulk resize images with image magick](bulk_resize_images_with_image_magick.md) 7 | * [flowcharts](flowcharts.md) 8 | * [icon edit online](icon_edit_online.md) 9 | * [paint.net layers](paint.net_layers.md) 10 | * [paint.net select single pixel](paint.net_select_single_pixel.md) 11 | * [sankey](sankey.md) 12 | * [sequence diagrams](sequence_diagrams.md) 13 | * [showcard gothic](showcard_gothic.md) 14 | -------------------------------------------------------------------------------- /windows/disable_cortana_in_windows_10.md: -------------------------------------------------------------------------------- 1 | # How to disable Cortana in Windows 10 (Anniversary Edition) 2 | 3 | > Click Start, type `gpedit.msc` and hit enter. 4 | > Navigate to `Computer Configuration` > `Administrative Templates` > `Windows Components` > `Search`. 5 | > Locate `Allow Cortana` and double-click on it to open the relevant policy. 6 | > Select `Disabled`. 7 | > Click `Apply` and `OK` to turn off Cortana. 8 | 9 | ## Source 10 | 11 | * -------------------------------------------------------------------------------- /.net_core_MVC/call_bash: -------------------------------------------------------------------------------- 1 | # How to call native commands from .net core. 2 | 3 | 4 | SOOOO easy! 5 | 6 | using System; 7 | 8 | namespace ConsoleApplication 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.WriteLine("Hello World!"); 15 | System.Diagnostics.Process.Start("ls"); // This works! 16 | 17 | } 18 | } 19 | } 20 | 21 | No need for any extra references or anything. -------------------------------------------------------------------------------- /.net_core_MVC/call_bash.md: -------------------------------------------------------------------------------- 1 | # How to call native commands from .net core. 2 | 3 | 4 | SOOOO easy! 5 | 6 | using System; 7 | 8 | namespace ConsoleApplication 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.WriteLine("Hello World!"); 15 | System.Diagnostics.Process.Start("ls"); // This works! 16 | 17 | } 18 | } 19 | } 20 | 21 | No need for any extra references or anything. -------------------------------------------------------------------------------- /office/outlook_calendar_celsius_fahrenheit.md: -------------------------------------------------------------------------------- 1 | # Show Celsius instead of Fehrenheit in the outlook calendar 2 | 3 | I didn't ask for this, but for some reason the Office 365 Outlook calendar tells me about the weather... in washington... in Fahrenheit. 4 | 5 | ![outlook_weather](outlook_weather.png) 6 | 7 | I changed the location to Brisbane Australia, but it continued to use Fahrenheit. 8 | 9 | The settings for Celsius/Fahrenheit are under `File | Settings | Calendar | Weather`. see: 10 | 11 | ![settings_celsius](settings_celsius.png) -------------------------------------------------------------------------------- /sparql/basics.md: -------------------------------------------------------------------------------- 1 | # sparql -- basics 2 | 3 | 4 | 5 | SELECT ?a ?b ?c 6 | WHERE 7 | { 8 | x y ?a. 9 | m n ?b. 10 | ?b f ?c. 11 | } 12 | LIMIT 10 13 | 14 | Note that `x y ?a.` 15 | 16 | ..means "x relates in way y to value ?a" 17 | 18 | ..e.g. `y` could be... "hasColor" ... or some other arbitrary relationship indicator. 19 | 20 | 21 | 22 | 23 | 24 | ## Source 25 | 26 | * 27 | * [Video: SPARQL in 11 minutes](https://www.youtube.com/watch?v=FvGndkpa4K0) -------------------------------------------------------------------------------- /visual_studio/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # visual studio 3 | ### chapter contents 4 | 5 | * [could not refresh credentials](could_not_refresh_credentials.md) 6 | * [ctor](ctor.md) 7 | * [html auto close tags](html_auto_close_tags.md) 8 | * [html surround with](html_surround_with.md) 9 | * [no exports were found that match the constraint](no_exports_were_found_that_match_the_constraint.md) 10 | * [nuget json dot net problem](nuget_json_dot_net_problem.md) 11 | * [proxy for devenv](proxy_for_devenv.md) 12 | * [tabs and spaces](tabs_and_spaces.md) 13 | -------------------------------------------------------------------------------- /vs_code/markdown_preview.md: -------------------------------------------------------------------------------- 1 | # Previewing markdown from within VS Code 2 | 3 | > Open any Markdown file and press Ctrl+Shift+V in 4 | >the editor to toggle between the code and a 5 | >preview of the Markdown file. You can view the 6 | >preview side-by-side with the file you are editing 7 | > and see changes reflected in real-time as you edit. 8 | 9 | * Split editor with `Ctrl+\` 10 | * Show preview: `Ctrl+Shift+V` 11 | * `Ctrl + Tab` 12 | 13 | # Source 14 | 15 | * https://code.visualstudio.com/Docs/languages/markdown 16 | -------------------------------------------------------------------------------- /concepts/happy_path.md: -------------------------------------------------------------------------------- 1 | # Happy Path 2 | 3 | When writing code (or documentation), the easiest case to consider is the 'happy path'. 4 | 5 | The happy path is the case where no exceptions occur, and no special checks or caveats are required. The happy path is that special set of circumstances in which all the easy assumptions hold. 6 | 7 | As a coder, or as a tester, or as a writer, or as a security expert, or as a politician, you spend the majority of your *actual* time, concerned with everything other than the happy path. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /github/github_pages_nojekyll.md: -------------------------------------------------------------------------------- 1 | # github pages: stop it from using jekyll 2 | 3 | Sometimes github pages gets into a weird mode where it wants to use jekyll, and doesn't know what theme to use, or, straight up refuses to serve my simple static html pages and returns a 404 page for everything... 4 | 5 | i found the way to get around this is to create a file called 6 | 7 | .nojekyll 8 | 9 | 0 bytes, empty file... but it does the job. 10 | 11 | Also remember that to enable github pages you go into settings for the repo and scroll down down down. -------------------------------------------------------------------------------- /linqpad/set_breakpoint.md: -------------------------------------------------------------------------------- 1 | # How do I launch the debugger and set a breakpoint in a linqpad script? 2 | 3 | I do this most days. The secret is: 4 | 5 | Debugger.Launch(); 6 | 7 | When the `Debugger.Launch()` line is hit you will be prompted to choose an instance of Visual Studio, or to open a new instance. 8 | 9 | # If you find that the Debugger.Launch line does not launch a debugger.... 10 | 11 | I had to toggle the "Compiler Optimizations" button (lower right) 12 | 13 | ![Compiler optimizations](compiler_optimizations.png) 14 | 15 | -------------------------------------------------------------------------------- /nimbletext/convert_date_uk_to_iso.md: -------------------------------------------------------------------------------- 1 | # Convert date from UK format to ISO 8601 2 | 3 | aka -- Convert date from Australian format to ISO 8601 4 | 5 | 6 | 7 | If '$1' is an australian or UK date such as: 8 | 9 | 4/09/2014 8:00 10 | 11/10/2015 1:00 11 | 27/11/2015 14:00 12 | 13 | And you want it as an ISO-8601 date such as: 14 | 15 | 2014-09-04 16 | 2015-10-11 17 | 2015-11-27 18 | 19 | Try this on.... 20 | 21 | <% $1.split('/')[2].split(' ')[0] %>-<% ('000' + $1.split('/')[1]).right(2) %>-<% ('00' + $1.split('/')[0]).right(2) %> 22 | -------------------------------------------------------------------------------- /npm/install_npm.md: -------------------------------------------------------------------------------- 1 | # install npm 2 | 3 | Install npm by installing node. 4 | 5 | Install node using chocolatey. 6 | 7 | choco install nodejs -y 8 | 9 | (`-y` means accept all prompts) 10 | 11 | Don't have chocolatey? [install chocolatey](../chocolatey/install_chocolatey.md). 12 | 13 | Next: add [tab completion](tab_completion_with_powershell.md) 14 | 15 | or 16 | 17 | [NPM -- some notes for beginners.](getting_started.md) 18 | 19 | 20 | ## See also 21 | 22 | * [NPM -- some notes for beginners.](getting_started.md) 23 | 24 | -------------------------------------------------------------------------------- /powershell/module_what_is_it.md: -------------------------------------------------------------------------------- 1 | # What is a module? 2 | 3 | > In its simplest form a module is a subfolder in one of the folders listed in $env:PSModulePath with a PowerShell script of the same name (but with the extension .psm1 instead of .ps1): 4 | [source](https://stackoverflow.com/questions/27713844/dot-source-a-script-within-a-function) 5 | 6 | The psm1 file ends with an `Export-ModuleMember` statement saying which functions and aliases to export., e.g. 7 | 8 | Export-ModuleMember -Function Get-Foo, New-Bar, ... -Alias gf, .. 9 | 10 | -------------------------------------------------------------------------------- /sleep/sleep_terminology.md: -------------------------------------------------------------------------------- 1 | # Sleep Terminology 2 | 3 | Regarding the title [Getting to Sleep and Staying Asleep](Getting_to_sleep_and_staying_asleep.md) article, there's some related terminology I want to record while I recall it. 4 | 5 | "Getting to sleep" is referred to as "sleep onset." If you have trouble getting to sleep, a specialist would say you have "delayed sleep onset." 6 | 7 | "Staying asleep" is referred to as "maintaining sleep." If you wake up and can't get back to sleep you have trouble with "sleep maintenance." 8 | 9 | 10 | -------------------------------------------------------------------------------- /html/scraping_files.md: -------------------------------------------------------------------------------- 1 | # Scraping html with C# 2 | 3 | use AngleSharp 4 | 5 | > It's a C# HTML (and otherML) parser which supports CSS selectors. Check it out next time you're playing with HTML in C#. 6 | 7 | Recommended by Richard Mason. 8 | 9 | Previously the HtmlAgilityPack was the tool of choice for this. 10 | 11 | The python project BeautifulSoup is a famous tool in this category. 12 | 13 | And regex is the other, more [eldritch](http://stackoverflow.com/a/1732454) option. 14 | 15 | ## Other keywords 16 | 17 | Screenscrape, screen scape -------------------------------------------------------------------------------- /windows/notepad_log_file.md: -------------------------------------------------------------------------------- 1 | # Using notepad as a log/journal 2 | 3 | If the first 4 letters of a text file are ".LOG" then when you launch that text file in `notepad`, instead of opening it at the top for reading, opens it at the bottom for appending. And automatically inserts a time and date stamp. 4 | 5 | (You may also know that F5 inserts a date/time stamp.) 6 | 7 | Tested in 2016, in Windows 10: still works. 8 | 9 | ## Source 10 | 11 | * http://weblog.jamisbuck.org/2015/3/17/task-tracking-for-neurochemical-brains.html#comment-2011700978 12 | -------------------------------------------------------------------------------- /macbook_air/serial_number.md: -------------------------------------------------------------------------------- 1 | # My Macbook is... 2 | 3 | * [MacBook Air (13-inch, Mid 2011) - Technical Specifications](https://support.apple.com/kb/SP683?viewlocale=en_US&locale=en_US) 4 | 5 | Serial Number: 6 | 7 | * C02H565NDJWV 8 | 9 | 10 | 11 | 12 | ## Source 13 | 14 | * [How to find the serial number on a macbook air](https://support.apple.com/en-au/HT201665) 15 | * [How to find the serial number on any apple product](https://support.apple.com/en-au/HT204308) 16 | * -------------------------------------------------------------------------------- /console/consolez.md: -------------------------------------------------------------------------------- 1 | # ConsoleZ as a replacement over Console2. 2 | 3 | choco install consoleZ 4 | 5 | (after first running as admin) 6 | 7 | Here's where I run console (Console2) from: 8 | 9 | $env:util\Console.exe 10 | 11 | Here's where choco installed ConsoleZ 12 | 13 | C:\ProgramData\chocolatey\lib\ConsoleZ\tools\console.exe 14 | 15 | 16 | To run consoleZ as admin: 17 | 18 | Start-Process "$env:ChocolateyInstall\lib\ConsoleZ\tools\console.exe" -Verb runAs 19 | 20 | 21 | (Assuming `$env:ChocolateyInstall` is correct) -------------------------------------------------------------------------------- /itunes/setup_as_new_ipad.md: -------------------------------------------------------------------------------- 1 | # setup as new ipad? 2 | 3 | we have an existing ipad, have used it for a year, but have never plugged it into a computer here. (it's a school ipad) 4 | 5 | we just plugged it in for the first time and were given two options: 6 | 7 | 1. restore from backup 8 | 2. setup as new ipad 9 | 10 | We definitely don't want 1. but are worried 2. will wipe the ipad. 11 | 12 | Internet research says no, it will not wipe the ipad, it just means that iTunes will now understand and recognise (and be able to backup) this 'new' ipad. 13 | 14 | -------------------------------------------------------------------------------- /reading_notes/kondo_tidying.md: -------------------------------------------------------------------------------- 1 | # The life changing magic of tidying - Marie Kondo 2 | 3 | 4 | 5 | Do one category at a time - not one place. 6 | 7 | Do the category completely and perfectly, not partially or imperfectly. 8 | 9 | 10 | 11 | In addition to monetary value, items have 3 types of value 12 | 13 | 14 | 15 | Function 16 | Information 17 | Emotional attachment 18 | 19 | 20 | Best category order to approach: 21 | 22 | 23 | 24 | Clothes 25 | Books 26 | Papers 27 | Miscellanies 28 | Kimono 29 | Sentimental and keepsakes 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /linqpad/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # linqpad 3 | ### chapter contents 4 | 5 | * [clear results](clear_results.md) 6 | * [connect to oracle](connect_to_oracle.md) 7 | * [csv to array](csv_to_array.md) 8 | * [datatable to csv](datatable_to_csv.md) 9 | * [group by](group_by.md) 10 | * [inspect clipboard](inspect_clipboard.md) 11 | * [invoke linqpad commandlet](invoke_linqpad_commandlet.md) 12 | * [offline registration](offline_registration.md) 13 | * [run linqpad scripts from commandline](run_linqpad_scripts_from_commandline.md) 14 | * [set breakpoint](set_breakpoint.md) 15 | -------------------------------------------------------------------------------- /windows/Turn_off_bing_search_results_from_Start_Menu.md: -------------------------------------------------------------------------------- 1 | # Turn off Bing Search Results from Start Menu in Windows 2 | 3 | When you do a search in the start menu in Windows 10, it shows Bing Search results. 4 | 5 | I don't want this. I never wanted this. I never will want this. 6 | 7 | Disable it with: 8 | 9 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0 10 | 11 | 12 | ## Source 13 | 14 | 15 | * [Nick Craver on twitter](https://twitter.com/Nick_Craver/status/1138231377055363074) -------------------------------------------------------------------------------- /concepts/getting_unblocked.md: -------------------------------------------------------------------------------- 1 | # Getting unblocked. 2 | 3 | I've written an interactive tutorial on this: 4 | 5 | > [Finding motivation when you're blocked](http://YourFirstProduct.com/Tools/Productive) 6 | 7 | Also, using [kv](http://www.secretgeek.net/kv), I have a template that I use: 8 | 9 | kv unblock "# VISION 10 | 11 | # PROJECT/CUSTOMER 12 | 13 | # TASKS 14 | 15 | # ISSUES 16 | 17 | See also http://YourFirstProduct.com/Tools/Productive 18 | " 19 | 20 | I paste that into my journal and fill out enough of it that I can move forward. -------------------------------------------------------------------------------- /google/capture_email.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Minimal Signup form 4 | 5 |

Minimal Signup form

6 |
7 |
name
8 |
email
9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /sql_server/simple_recovery_model.md: -------------------------------------------------------------------------------- 1 | # Set a database to simple recovery model 2 | 3 | This is how you turn off needing to log everything. 4 | 5 | Simple recovery model is ok for dev, not for prod. 6 | 7 | 8 | 9 | ALTER DATABASE MyDatabase SET RECOVERY SIMPLE; 10 | 11 | 12 | To find the current recover model: 13 | 14 | 15 | SELECT name, recovery_model_desc 16 | FROM sys.databases 17 | WHERE name = 'MyDatabase' ; 18 | GO 19 | 20 | 21 | example: 22 | 23 | 24 | |name|recovery_model_desc| 25 | |----|-------------------| 26 | |MyDatabase|FULL| -------------------------------------------------------------------------------- /.net/zipfile.md: -------------------------------------------------------------------------------- 1 | # Zip a single file 2 | 3 | This is a minimal C# function (usable from Linqpad) to Zip a single file into its own archive. 4 | 5 | References these libraries: 6 | 7 | * `System.IO.Compression.dll` 8 | * `System.IO.Compression.FileSystem.dll` 9 | 10 | 11 | using System.IO.Compression; 12 | 13 | public void Zipit(string zipPath, string sourceFilePath) 14 | { 15 | var file = Path.GetFileName(sourceFilePath); 16 | using (ZipArchive archive = ZipFile.Open(zipPath, ZipArchiveMode.Create)) 17 | archive.CreateEntryFromFile(sourceFilePath, file); 18 | } -------------------------------------------------------------------------------- /design/designs_i_love.md: -------------------------------------------------------------------------------- 1 | # designs i love 2 | 3 | i worked out that as part of working toward creating your branding/personality feel it's good to keep track of the things that catch your eye and which you love. 4 | 5 | you can certainly use a site like pinterest for this (or even pinboard/delicious) -- but since i like to use my `til` files for everything i'll just do that instead. 6 | 7 | 8 | 9 | Several of the pages here: 10 | 11 | * 12 | * 13 | 14 | 15 | * of course... so beautiful -------------------------------------------------------------------------------- /console/cmder_powershell.md: -------------------------------------------------------------------------------- 1 | # cmder powershell settings 2 | 3 | Under settings | Startup | Tasks 4 | 5 | Move {Powershell::Powershell} to the top of the list. 6 | 7 | Click "Default task for new console" 8 | 9 | The commands for {Powershell::Powershell} start as: 10 | 11 | PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''" -new_console:d:"%USERPROFILE%" 12 | 13 | Change this to: 14 | 15 | 16 | PowerShell -ExecutionPolicy Bypass -NoLogo -NoExit -new_console:d:"C:\wip\Scratch\nimble" 17 | 18 | -------------------------------------------------------------------------------- /git/merge_pull_request.md: -------------------------------------------------------------------------------- 1 | # Merge pull request via command line 2 | 3 | If you do not want to use the merge button (or an automatic merge cannot be performed) you can perform a manual merge on the command line. 4 | 5 | 6 | Step 1: From your project repository, check out a new branch and test the changes. 7 | 8 | git checkout -b doekman-master master 9 | git pull https://github.com/doekman/console-adventure.git master 10 | 11 | Step 2: Merge the changes and update on GitHub. 12 | 13 | git checkout master 14 | git merge --no-ff doekman-master 15 | git push origin master -------------------------------------------------------------------------------- /jquery/textarea_keypress.md: -------------------------------------------------------------------------------- 1 | # Jquery event on textarea change 2 | 3 | This is surprising and has gone through a few changes across the years. 4 | 5 | 6 | 7 | var oldVal = ""; 8 | 9 | $("#textarea").on("change keyup paste", function() { 10 | var currentVal = $(this).val(); 11 | if(currentVal == oldVal) { 12 | return; //check to prevent multiple simultaneous triggers 13 | } 14 | 15 | oldVal = currentVal; 16 | //action to be performed on textarea changed 17 | alert("changed!"); 18 | }); 19 | 20 | 21 | -------------------------------------------------------------------------------- /math/eulers_number.md: -------------------------------------------------------------------------------- 1 | # Euler's Number 2 | 3 | `e` is Euler's numbers 4 | 5 | Approx. 2.718 it is the limit of (1+1/x)^x as x approaches infinity. 6 | 7 | ## How to display e on a scientific calculator. 8 | 9 | (How to display Euler's number on a calculator in Windows) 10 | 11 | To show it on a scientific calculator... 12 | 13 | ![eulers_number](eulers_number.png) 14 | 15 | You need to use the `e^x` button which is only visible when you click the `Inv` button. 16 | 17 | So enter the number `1`. Click `Inv` then `e^x` and you will thus find the value of `e^1`, i.e. `e`. 18 | 19 | -------------------------------------------------------------------------------- /concepts/regression_to_the_mean.md: -------------------------------------------------------------------------------- 1 | # Regression to the mean 2 | 3 | Had a fantastic start to the day? 4 | 5 | Don't worry the rest of the day will be less fantastic. 6 | 7 | Had a terrible horrible no-good entirely tragic start to the year? 8 | 9 | Don't worry the rest of the year will be less terrible. 10 | 11 | It's not the universe "making up for things" it's just what the pundits call [regression to the mean](https://en.wikipedia.org/wiki/Regression_toward_the_mean) 12 | 13 | Read "thinking fast and slow" by Daniel Kahneman to learn a lot more about this. 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /powershell/interactive_remote_script.md: -------------------------------------------------------------------------------- 1 | # Want to prompt user for credentials and then run a script on a remote machine? 2 | 3 | 4 | Assuming the Remote Computer Name is stored in a variable `$remoteComputerName` 5 | 6 | 7 | $name = Read-Host ("What is the account name to use for remote execution, please include the domain, e.g. AD\" + $env:username + ")") 8 | 9 | Invoke-Command -ComputerName $remoteComputerName -ScriptBlock { 10 | 11 | # Commands in here are remote executed, hence relative to $remoteComputerName 12 | 13 | } -credential $name 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /react/javascript_1.7.md: -------------------------------------------------------------------------------- 1 | ## Javascript 1.7 2 | 3 | > JavaScript 1.7 is a language update introducing several new features, in particular generators, iterators, array comprehensions, let expressions, and destructuring assignment. 4 | 5 | — [MDN Javascript 1.7](https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7) 6 | 7 | > In order to use some of the new features of JavaScript 1.7, you need to specify that you wish to use JavaScript 1.7 8 | 9 | 12 | -------------------------------------------------------------------------------- /sql_server/identity_insert_off.md: -------------------------------------------------------------------------------- 1 | # How to insert identity values into an identity column 2 | 3 | Just try it and you'll get: 4 | 5 | Msg 544, Level 16, State 1, Line 6 6 | Cannot insert explicit value for identity column in table 'YourTable' when IDENTITY_INSERT is set to OFF. 7 | 8 | So simply: 9 | 10 | SET IDENTITY_INSERT YourTable ON 11 | 12 | INSERT sometableWithIdentity (ID, col2, col3, ...) 13 | VALUES (33, 'fred', 'smith', ...) 14 | 15 | SET IDENTITY_INSERT YourTable OFF 16 | 17 | But first: 18 | 19 | > Have you tried *not* explicity setting a value for the identity column? -------------------------------------------------------------------------------- /chapter_summary.txt: -------------------------------------------------------------------------------- 1 | {powershell: 2 | 3 | $currentFolder = ($file -split '\\')[-2] 4 | $currentPath = ((pwd).path -split '\\')[-1] 5 | 6 | if ($currentPath -ne $currentfolder) 7 | { 8 | pushd $currentFolder; 9 | $doPop = $true 10 | } 11 | 12 | "" 13 | ("# " + $currentFolder.replace("_"," ")) 14 | "### chapter contents" 15 | " " 16 | #" * [$currentFolder](01_summary.md)" 17 | 18 | Get-ChildItem . *.md | 19 | ? { $_.Name -ne "01_summary.md" } | 20 | % { "* [" + ($_.Name.replace(".md","").replace("_"," ")) + "]($_)"} 21 | 22 | if ($doPop) { popd; $doPop = $false; } 23 | 24 | :} -------------------------------------------------------------------------------- /music/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # music 3 | ### chapter contents 4 | 5 | * [4 types of basslines](4_types_of_basslines.md) 6 | * [7th chords](7th_chords.md) 7 | * [Ableton](Ableton.md) 8 | * [background noise](background_noise.md) 9 | * [Bb Trumpet](Bb_Trumpet.md) 10 | * [drum beats](drum_beats.md) 11 | * [guitar dashboard](guitar_dashboard.md) 12 | * [guitar finger names](guitar_finger_names.md) 13 | * [guitar shapes](guitar_shapes.md) 14 | * [PC guitar effects](PC_guitar_effects.md) 15 | * [scales and emotions](scales_and_emotions.md) 16 | * [take it slow](take_it_slow.md) 17 | * [tension](tension.md) 18 | -------------------------------------------------------------------------------- /powershell/sort.md: -------------------------------------------------------------------------------- 1 | # To Sort Unique 2 | 3 | sort -unique 4 | 5 | e.g. 6 | 7 | 1..100 | % { $_ % 5} | sort -unique 8 | 9 | # To Sort by a Property 10 | 11 | use: 12 | 13 | sort -property "propertyName" 14 | 15 | e.g. 16 | 17 | get-alias -def "get*" | sort -property definition | ft -property Name, Definition 18 | 19 | Another example: 20 | 21 | You can sort a file's content by the length of its lines by using: 22 | 23 | cat $file | sort -property Length 24 | 25 | To sort by file date descending (and pick only the top 10): 26 | 27 | dir | sort lastwritetime -desc | select -f 10 28 | -------------------------------------------------------------------------------- /sql_server_reporting_services/view_report_data.md: -------------------------------------------------------------------------------- 1 | # View "Report Data" 2 | 3 | The "Report Data" pane is the one that lets you edit: 4 | 5 | * Built-in Fields 6 | * Parameters 7 | * Images 8 | * Data Sources 9 | * Datasets 10 | 11 | If you ever close it, it can be a hell of a job trying to find it again. 12 | 13 | Here's the trick: 14 | 15 | In the "Design" view, click anywhere on the report canvas outside of the report. i.e. on the background of the canvas on which the report is being designed. 16 | 17 | Then, in the view menu, the option "Report Data" will be shown. Or click `Ctrl`+`Alt`+`D`. 18 | 19 | -------------------------------------------------------------------------------- /reading_notes/Jiwa_hunch.md: -------------------------------------------------------------------------------- 1 | # Hunch, Bernadette jiwa 2 | 3 | 4 | 5 | Common aspect to these stories 6 | 7 | Scratching your own itch 8 | 9 | Gatekeepers and decision makers are men who mostly reject the ideas. Some men listen to significant women in their lives (mostly daughters, spanx Harry Potter ) and took a 'risk' on the product. 10 | 11 | 12 | 13 | Scooter distributor story is like that too. 14 | 15 | 16 | 17 | And harry Chapins secretary told him about a note her son received 18 | 19 | 20 | 21 | I could focus on sending email asking for feedback from women who buy my products. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /stackexchange/back_off.md: -------------------------------------------------------------------------------- 1 | # backoff (i.e. slow down) hitting the API 2 | 3 | Here's what the JSON looks like when the stackexchange api tells you to backoff (i.e. to make less requests)... 4 | 5 | { 6 | "items": [ 7 | { 8 | ... 9 | } 10 | ], 11 | "backoff": 10 12 | } 13 | 14 | Here's how I back off... 15 | 16 | 17 | if (jsonBody.IndexOf("backoff") >= 0) 18 | { 19 | if (data.backoff != null) 20 | { 21 | int delay = (int)data.backoff.Value; 22 | System.Threading.Thread.Sleep(delay * 1000); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /windows/screenshot_with_mouse_cursor.md: -------------------------------------------------------------------------------- 1 | # Need to include the mouse cursor/pointer in a screenshot? 2 | 3 | Not like this: 4 | 5 | ![manual screenshot](screenshots.jpg) 6 | 7 | Like this: 8 | 9 | Use greenshot "a free screenshot tool optimized for productivity" 10 | 11 | 12 | ## Source 13 | 14 | * Image from [How to Make a Killer Explainer Video for Your Brand's Homepage - the Ultimate Guide](https://librisblog.photoshelter.com/how-to-use-video-marketing-brand-website/) 15 | 16 | ## Links 17 | 18 | * Download http://getgreenshot.org/downloads/ 19 | * Source code https://bitbucket.org/greenshot/greenshot/ 20 | -------------------------------------------------------------------------------- /visual_studio/html_auto_close_tags.md: -------------------------------------------------------------------------------- 1 | # Auto Insert close tag 2 | 3 | When I type <p> and it automatically inserts </p> .... I find that strangely annoying... 4 | 5 | Probably because that is only helpful if you write in a linear manner, from beginning to end... and I rarely do that. 6 | 7 | I spend more time editing any file than I do writing it the first time. 8 | 9 | So -- to turn off that behavior: 10 | 11 | go to: 12 | 13 | > Tools | Options | Text Editor | HTML | Formatting 14 | 15 | Under: 16 | 17 | > "Automatic formatting options" 18 | 19 | > "Auto Insert close tag" ← uncheck that!! 20 | 21 | -------------------------------------------------------------------------------- /windows.forms/DPI_aware_winforms.md: -------------------------------------------------------------------------------- 1 | # DPI Aware Winforms apps 2 | 3 | I still struggle with this, but here's my approach currently (2019) 4 | 5 | Firstly, in Main(): 6 | 7 | if (Environment.OSVersion.Version.Major >= 6) 8 | SetProcessDPIAware(); 9 | 10 | 11 | Where: 12 | 13 | 14 | [DllImport("user32.dll")] 15 | private static extern bool SetProcessDPIAware(); 16 | 17 | This code requires these using statements 18 | 19 | using System; 20 | using System.Runtime.InteropServices; 21 | 22 | 23 | It may or may not be important to set `AutoScaleMode` of forms to `Dpi` (instead of their default of `Font`). 24 | 25 | -------------------------------------------------------------------------------- /.net/config_external_source.md: -------------------------------------------------------------------------------- 1 | # Config from an external source 2 | 3 | Say you want your connectionStrings to be pulled in from an external file, you can do that like this: 4 | 5 | 6 | 7 | 8 | That way, for example, your `web.config`, your `application.config` (for some other apps) and your `linqpad.config` can all use the exact same file for connectionStrings (even though the rest of their config is very unique. 9 | 10 | Or if you have 3 different web applications that all want the same config for just part of their config file, you can use this trick. -------------------------------------------------------------------------------- /concepts/idea_transmission.md: -------------------------------------------------------------------------------- 1 | # The Wisdom or Madness of Crowds 2 | 3 | 4 | > A healthy society needs a sweetspot of bonds within groups and bridges between groups. 5 | > 6 | > -- [Nicky Case](https://ncase.me/crowds/) 7 | 8 | 9 | ![A healthy society needs a sweetspot of bonds within groups and bridges between groups](The_Wisdom_and_or_Madness_of_Crowds.png) 10 | 11 | 12 | 13 | ## Source 14 | 15 | * [The Wisdom and or Madness of Crowds](https://ncase.me/crowds/) -- explorable explanation 16 | * [Going Critical](https://www.meltingasphalt.com/interactive/going-critical/) -- about infection/transmission/connectedness 17 | -------------------------------------------------------------------------------- /google/chrome_before_flight.md: -------------------------------------------------------------------------------- 1 | # Chrome before flight 2 | 3 | 4 | @JakeGinnivan says: Just found out about chrome://flags/#show-saved-copy - *really* useful to turn on before flights! 5 | 6 | Help details: 7 | 8 | > When a page fails to load, if a stale copy of the page exists in the browser cache, a button will be presented to allow the user to load that stale copy. The primary enabling choice puts the button in the most salient position on the error page; the secondary enabling choice puts it secondary to the reload button 9 | 10 | Note that this change will take effect the next time you relaunch Google Chrome. 11 | 12 | -------------------------------------------------------------------------------- /virtual_box/virtual_box_warning.md: -------------------------------------------------------------------------------- 1 | # Virtual Box warning during installation 2 | 3 | During installation of virtual box, this warning is designed to cause maximum fright 4 | 5 | > Warning: Network Interfaces 6 | > Installing the Oracle VM VirtualBox 5.0.12 Networking 7 | > feature will reset your network connection and temporarily 8 | > disconnect you from the network. 9 | > 10 | > Proceed with installation now?
11 | > Yes or NO 12 | 13 | ![Virtual Box Warning](VirtualBoxWarning.png) 14 | 15 | 16 | 17 | Like the badass that I am, I clicked yes. If I did go offline I didn't notice. It was over in less than 2 minutes. -------------------------------------------------------------------------------- /linqpad/offline_registration.md: -------------------------------------------------------------------------------- 1 | # Offline registration 2 | 3 | 4 | You can activate LINQPad on a machine without Internet connectivity if you go through a few extra steps: 5 | 6 | 1. Purchase an activation code and try to activate LINQPad - and wait until LINQPad displays an error. 7 | 8 | 2. The clipboard will now contain an extended code. (An extended code is automatically copied to the clipboard whenever there is an error activating LINQPad.) 9 | 10 | Paste that code into the box on this page: https://www.linqpad.net/licensing/offline.aspx 11 | 12 | 13 | # Source 14 | 15 | * https://www.linqpad.net/licensing/offline.aspx -------------------------------------------------------------------------------- /music/Ableton.md: -------------------------------------------------------------------------------- 1 | # Learning to make music with abelton 2 | 3 | 4 | 5 | * Beats 6 | * Notes and scales 7 | * Chords 8 | * Basslines 9 | * Melodies 10 | * Song structure 11 | 12 | 13 | Also from ableton: 14 | 15 | 16 | 17 | 18 | * Envelopes 19 | * LFOs 20 | * Oscillators 21 | * Filters 22 | * Recipes 23 | * Playground 24 | 25 | 26 | A different tool.... 27 | 28 | [Musical Chord Progression Arpeggiator](https://codepen.io/jakealbaugh/full/qNrZyw) 29 | 30 | 31 | ## External links 32 | 33 | * -------------------------------------------------------------------------------- /music/tension.md: -------------------------------------------------------------------------------- 1 | # Tension 2 | 3 | Music is often about creating "tension" (and release). 4 | 5 | For example, 12-bar blues are like this (where each letters represents a bar) 6 | 7 | A-A-A-A 8 | D-D-A-A 9 | E-D-A-E 10 | ...and back to the start. For hours. 11 | 12 | Throughout the 12 bars, the tension gradually builds. 13 | 14 | If you do it right then the tension has built so much that by that final bar ('the turn around') you can throw everything you've got at the instrument, dogs, chickens, bottles, a whole piano. And then we're back on the flat again, stepping through the A's. 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tools/about_utils.md: -------------------------------------------------------------------------------- 1 | # About utils 2 | 3 | Quick note on any utils, (where note is too brief to warrant a whole file) 4 | 5 | 6 | ## Capturing animated gifs 7 | 8 | Two super simple apps for this, LICEcap and gifcam. Gifcam (from ) lets you edit/remove frames. 9 | 10 | 11 | 12 | ## Hard drive space -- squarified treemap 13 | 14 | SpaceSniffer is my current go to tool for working out where all your hard drive space went. Previously used SpaceMonger, and at one time used SequoiaView. 15 | 16 | I noticed recently that the industry favorite WinDirStat also includes a squarified treemap. 17 | -------------------------------------------------------------------------------- /git/version.md: -------------------------------------------------------------------------------- 1 | # What version of git am I running? 2 | 3 | use: 4 | 5 | git --version 6 | 7 | e.g. 8 | 9 | > git --version 10 | git version 2.7.0.windows.1 11 | 12 | 13 | In [Powershell](../powershell/01_summary.md), `which git` will also give you the answer you seek. For example: 14 | 15 | > which git 16 | 17 | CommandType Name Version Source 18 | ----------- ---- ------- ------ 19 | Application git.exe 2.7.0.0 C:\Program Files\Git\cmd\git.exe 20 | -------------------------------------------------------------------------------- /powershell/rename_with_force.md: -------------------------------------------------------------------------------- 1 | # Rename with Force 2 | 3 | You want to rename a file, but the new file already exists. 4 | 5 | ren file.old file.new 6 | ren : Cannot create a file when that file already exists. 7 | 8 | (ren is an alias for `Rename-Item`) 9 | 10 | You think "I know, I'll use (the) force!" 11 | 12 | ren file.old file.new -Force 13 | ren : Cannot create a file when that file already exists. 14 | 15 | But that doesn't work either.... 16 | 17 | You google and feel like a fool, but eventually determine you need to use `Move-Item` 18 | 19 | mv file.old file.new -Force 20 | 21 | Q.E.D. 22 | 23 | -------------------------------------------------------------------------------- /notepad++/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # notepad++ 3 | ### chapter contents 4 | 5 | * [disable automatic parens completion](disable_automatic_parens_completion.md) 6 | * [error downloading the plugin list](error_downloading_the_plugin_list.md) 7 | * [expand collapse](expand_collapse.md) 8 | * [install textfx plugin](install_textfx_plugin.md) 9 | * [navigate back](navigate_back.md) 10 | * [plugins](plugins.md) 11 | * [shortcut close document](shortcut_close_document.md) 12 | * [tell notepad++ about a new file type](tell_notepad++_about_a_new_file_type.md) 13 | * [todays date](todays_date.md) 14 | * [trim trailing and save](trim_trailing_and_save.md) 15 | -------------------------------------------------------------------------------- /linux/xlsx_to_csv.md: -------------------------------------------------------------------------------- 1 | # Convert excel spreadsheet to csv on linux (xlsx to csv) 2 | 3 | 4 | Get gnumeric 5 | 6 | apt-get install gnumeric 7 | 8 | 9 | Then use ssconvert to do the conversion 10 | 11 | 12 | ssconvert oldfile.xlsx newfile.csv 13 | 14 | On a headless server (such as a droplet) it may issue a lot of warnings. Pipe output and warning to `null` via: 15 | 16 | ssconvert oldfile.xlsx newfile.csv > /dev/null 2>&1 17 | 18 | 19 | 20 | Well this is a nifty trick! 21 | 22 | ## Source 23 | 24 | * [Convert xlsx to csv in linux command line](http://stackoverflow.com/questions/10557360/convert-xlsx-to-csv-in-linux-command-line) -------------------------------------------------------------------------------- /powershell/count_repositories.md: -------------------------------------------------------------------------------- 1 | # How to count mercurial repositories (or git repositories) 2 | 3 | 4 | This recursive function will find all the repositories in a given location, and output their names/locations. 5 | 6 | 7 | function SearchForRepos($fullPath) { 8 | $isRepo = (gci $fullpath ".hg" | measure-object | % { $_.Count }) 9 | 10 | if ($isRepo -eq 1) { 11 | $fullPath 12 | } else { 13 | get-childitem $fullPath | ?{ $_.PSIsContainer } | 14 | % { SearchForRepos $_.FullName } 15 | } 16 | } 17 | 18 | SearchForRepos "X:\Repositories\" | ? { $_ -notlike '*\Legacy\*' } | out-file "C:\wip\Repositories.csv" 19 | 20 | -------------------------------------------------------------------------------- /git/access_github_behind_corporate_proxy.md: -------------------------------------------------------------------------------- 1 | # How to access github behind a corporate proxy 2 | 3 | If you receive an error when attempting to use `git://` github addresses behind your corporate proxy, try adding these to config: 4 | 5 | 6 | git config --global url.https://github.com/.insteadof git://github.com/ 7 | 8 | and 9 | 10 | git config --global http.https://github.com.proxy http://yourproxy:8080 11 | 12 | (but you will need to know the name/port of your proxy) 13 | 14 | Those settings adds this to ~/.gitconfig 15 | 16 | [url "https://github.com/"] 17 | insteadof = git://github.com/ 18 | [http "https://github.com"] 19 | proxy = http://yourproxy:8080 -------------------------------------------------------------------------------- /powershell/runas.md: -------------------------------------------------------------------------------- 1 | ## For a new process to runas a different (admin) user from powershell 2 | 3 | 4 | 5 | #run a new console window as admin, like so: 6 | Start-Process console.exe -Verb runAs 7 | #Or you might prefer 8 | Start-Process powershell -Verb runAs 9 | 10 | Or better yet.. 11 | 12 | Start-Process "$env:ChocolateyInstall\lib\ConsoleZ\tools\console.exe" -Verb runAs 13 | 14 | Start-Process C:\Users\Leon\Downloads\cmder_mini\vendor\conemu-maximus5\ConEmu64.exe -Verb runAs 15 | 16 | Or simply: 17 | 18 | Start-Process ConEmu64.exe -Verb runAs 19 | 20 | 21 | ![run... run as administrator](Run_Runas_Administrator.jpg) -------------------------------------------------------------------------------- /google/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # google 3 | ### chapter contents 4 | 5 | * [chrome before flight](chrome_before_flight.md) 6 | * [chrome design mode](chrome_design_mode.md) 7 | * [chrome on startup](chrome_on_startup.md) 8 | * [chrome reader mode](chrome_reader_mode.md) 9 | * [chrome reopen closed tabs](chrome_reopen_closed_tabs.md) 10 | * [customsearch api](customsearch_api.md) 11 | * [dead mans switch](dead_mans_switch.md) 12 | * [google analytics add new site](google_analytics_add_new_site.md) 13 | * [largest files in gmail](largest_files_in_gmail.md) 14 | * [post to google sheets](post_to_google_sheets.md) 15 | * [search by file extension](search_by_file_extension.md) 16 | -------------------------------------------------------------------------------- /sql_server/ctrl_e_execute.md: -------------------------------------------------------------------------------- 1 | # Use Ctrl-E to execute your query 2 | 3 | I'm very used to using Ctrl-E to execute my query. 4 | 5 | In a recent version of SQL Server Management Studio this key combo was no longer mapped. 6 | 7 | To get it mapped again: 8 | 9 | ![ctrl_e_execute.png](ctrl_e_execute.png) 10 | 11 | Tools | Options | Environment | Keyboard | Query.Execute 12 | 13 | Go into "Press shortcut keys", hit Ctrl-E and it'll show you that you're overwriting the combo for word wrap or something. 14 | 15 | Do it! 16 | 17 | SIMILARLY.... Query.ResultsToGrid should be Ctrl-D but is not. So fix that while you're there. 18 | 19 | (I'm not even game to check up on Alt-X) -------------------------------------------------------------------------------- /graphics/bulk_resize_images_with_image_magick.md: -------------------------------------------------------------------------------- 1 | # Bulk resize images with image magick 2 | 3 | When I need to resize images, in bulk (or even one at a time) and I want them to stay sharp, i use ImageMagick 4 | 5 | > magick human_resource_machine.png -resize 200 -unsharp 0x6+0.5+0 human_resource_machine_200.png 6 | 7 | This gives the file a width of 200 pixels, and a height in proportion to the current aspect ratio. 8 | 9 | It also applies an `unsharp` filter, which sharpens the image (go figure!) 10 | 11 | ImageMagick is here (and is in my `path`) 12 | 13 | C:\Program Files\ImageMagick-7.0.7-Q16\magick.exe 14 | 15 | # See also 16 | 17 | * [Set path](../powershell/PATH.md) -------------------------------------------------------------------------------- /graphics/paint.net_layers.md: -------------------------------------------------------------------------------- 1 | # Paint.Net Layers 2 | 3 | There's only one secret to mastering Paint.Net. 4 | 5 | Put everything in a separate layer. 6 | 7 | For example: 8 | 9 | * Every part of a drawing/diagram should have its own layer. 10 | * Before applying an effect to a layer -- clone the layer, and hide the original. 11 | 12 | Get very comfortable with all the layer related features: 13 | 14 | * New layer 15 | * Clone layer 16 | * Delete layer 17 | * Move Layer Up 18 | * Move Layer Down 19 | * Edit the transparency of a layer 20 | * Switch a layer on/off 21 | * Paste in to new layer 22 | 23 | Save the file as a .pdn file, and export copies as .png. 24 | 25 | -------------------------------------------------------------------------------- /nuget/consolidate_nuget_packages.md: -------------------------------------------------------------------------------- 1 | # Projects within a solution use different versions of the same nuget package, consolidate them! 2 | 3 | Right click on the solution and choose 4 | 5 | Manage NuGet Packages for Solution... 6 | 7 | This brings you to a page with tabs: `Browse`, `Installed`, `Updates` and `Consolidate` 8 | 9 | The "Consolidate" page is super handy. It lists any packages which have inconsistent versions across projects. 10 | 11 | ![consolidate_nuget_packages](consolidate_nuget_packages.png) 12 | 13 | Click the `Install` button in the lower right to bring them all into line, on the latest version. (Or pick a specific version before pressing `Install`) 14 | 15 | -------------------------------------------------------------------------------- /sql_server/drive_sizes.md: -------------------------------------------------------------------------------- 1 | # How much space is left on the drives that my sql server can access? 2 | 3 | To view how much remaining space you have on the drives your sql server can see, use this command.... 4 | 5 | EXEC master..xp_fixeddrives 6 | 7 | 8 | |drive|MB free| 9 | |-----|-------| 10 | | C | 12912| 11 | | D | 48222| 12 | | E | 201482| 13 | 14 | 15 | This extended stored procedure seems to be able to be executed even by low privilege accounts. 16 | 17 | 18 | ## See also 19 | 20 | * [Backup restore script](backup_restore_script.md) 21 | * [Need to delete backup files?](delete_backup_files.md) 22 | * [How much space does my DB use?](how_much_space_does_my_db_use.md) -------------------------------------------------------------------------------- /asp.net_mvc/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # asp.net mvc 3 | ### chapter contents 4 | 5 | * [asp net mvc 3 patch](asp_net_mvc_3_patch.md) 6 | * [clear caches](clear_caches.md) 7 | * [custom errors](custom_errors.md) 8 | * [elmah](elmah.md) 9 | * [from memory](from_memory.md) 10 | * [helpful error page](helpful_error_page.md) 11 | * [return 404](return_404.md) 12 | * [scripts sections](scripts_sections.md) 13 | * [select dropdowns](select_dropdowns.md) 14 | * [select dynamic dropdowns](select_dynamic_dropdowns.md) 15 | * [select multi dropdowns](select_multi_dropdowns.md) 16 | * [serve some static files from mvc but not all](serve_some_static_files_from_mvc_but_not_all.md) 17 | * [troller](troller.md) 18 | -------------------------------------------------------------------------------- /powershell/convert_KB_MB_GB.md: -------------------------------------------------------------------------------- 1 | # How to convert between kilobytes megabytes gigabytes etc? 2 | 3 | It's easy! 4 | 5 | (763392)/ 1KB 6 | 745.5 7 | 8 | (763392)/ 1MB 9 | 0.72802734375 10 | 11 | How bout gigabytes, terrabytes or petabytes? 12 | 13 | (763392)/ 1GB 14 | 0.000710964202880859 15 | 16 | (763392)/ 1TB 17 | 6.94300979375839E-07 18 | 19 | (763392)/ 1PB 20 | 6.78028300171718E-10 21 | 22 | 23 | |unit|size| 24 | |----|----| 25 | |1KB|1024| 26 | |1MB|1048576| 27 | |1GB|1073741824| 28 | |1TB|1099511627776| 29 | |1PB|1125899906842624| 30 | 31 | And you can round them, as follows: 32 | 33 | (763392/1MB).ToString("0.00") 34 | 0.73 35 | -------------------------------------------------------------------------------- /windows.forms/using_dark_theme.md: -------------------------------------------------------------------------------- 1 | # Test if windows is using light/dark theme 2 | 3 | This is not yet battle tested 4 | 5 | //using Microsoft.Win32 6 | public bool WindowsIsUsingDarkTheme() 7 | { 8 | var keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; 9 | var valueName = "AppsUseLightTheme"; 10 | var value = Registry.GetValue(keyName, valueName, null); 11 | if (value == null) 12 | { 13 | return false; 14 | } 15 | 16 | if (int.TryParse(value.ToString(), out int result)){ 17 | return result == 0; 18 | } 19 | 20 | return false; 21 | } 22 | 23 | Source: https://gist.github.com/secretGeek/fa0ea0039f0c5eaa7d122fe569fa2b44 -------------------------------------------------------------------------------- /powershell/boot_time.md: -------------------------------------------------------------------------------- 1 | # Find last boot time 2 | 3 | When did we last reboot this machine? What's the current uptime? How long since boot, since reboot, since last boot, since last reboot? 4 | 5 | In powershell 2: 6 | 7 | Get-WmiObject win32_operatingsystem | select csname, @{LABEL='LastBootUpTime';EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}} 8 | 9 | In Powershell 3+ 10 | 11 | Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime 12 | 13 | 14 | 15 | ## Source 16 | 17 | * [PowerTip: Get the Last Boot Time with PowerShell](https://blogs.technet.microsoft.com/heyscriptingguy/2013/03/27/powertip-get-the-last-boot-time-with-powershell/) -------------------------------------------------------------------------------- /.net_core_MVC/bind_post_to_action.md: -------------------------------------------------------------------------------- 1 | # Bind JSON POST to MVC Action 2 | 3 | You already put a `[method: HttpPost]` attribute on the action. 4 | 5 | But when you look at the received parameter, it is null. 6 | 7 | Hint: try the `[FromBody]` attribute on the parameters. 8 | 9 | And ensure the POST is given a `Content-type` of `application/json` 10 | 11 | x.setRequestHeader('Content-type', 'application/json') 12 | 13 | ## Sources 14 | 15 | * [Andrew Lock: Model binding JSON POSTs in ASP.NET Core](https://andrewlock.net/model-binding-json-posts-in-asp-net-core/) 16 | * [.Net Core Model Binding JSON Post To Web API](https://stackoverflow.com/questions/45086480/net-core-model-binding-json-post-to-web-api) -------------------------------------------------------------------------------- /.net_core_MVC/no_authentication_handler.md: -------------------------------------------------------------------------------- 1 | # Overcoming "No authentication handler is configured to handle the scheme: Identity.Application" 2 | 3 | 4 | This error: 5 | 6 | 7 | InvalidOperationException: No authentication handler is configured to handle the scheme: Identity.Application 8 | 9 | 10 | 11 | For me, it was because in: 12 | 13 | public void Configure 14 | 15 | 16 | I had simply left out: 17 | 18 | app.UseIdentity(); 19 | 20 | 21 | (Which goes just before `app.UseMvc(routes =>` ) 22 | 23 | ## Further reading 24 | 25 | * [One of the answers at: "No authentication handler is configured to handle the scheme: Automatic"](http://stackoverflow.com/a/33989656/49) -------------------------------------------------------------------------------- /notepad++/tell_notepad++_about_a_new_file_type.md: -------------------------------------------------------------------------------- 1 | # Telling NotePad++ About a New File Type 2 | 3 | (example, adding .config as xml) 4 | 5 | 6 | * Go to Settings > Style Configurator... 7 | * Under Language, scroll down and highlight "XML" 8 | * Beneath the Language list, find User ext. textbox and add "config" to the list. (That textbox contains a space-delimited list of extensions. Do not include the dot (e.g. "xml config" not ".xml .config") 9 | * Press Save & Close 10 | * You will need to close and reopen the file, for the syntax highlighting to take effect. 11 | 12 | 13 | ## Source 14 | 15 | * [The Zen of Telling Notepad++ That .Config Files are XML](http://www.secretgeek.net/notepad_plus_plus_config) -------------------------------------------------------------------------------- /powershell/version.md: -------------------------------------------------------------------------------- 1 | # How can I tell which version of powershell I have? 2 | 3 | $PSVersionTable.PSVersion 4 | 5 | (Compared to this DOS classic: `ver`) 6 | 7 | So I've added this to my profile: 8 | 9 | function ver() { 10 | $PSVersionTable.PSVersion 11 | } 12 | 13 | But you might also need to consider where the [currently running shell is 64 or 32 bit](is_this_64_or_32_bit_powershell_today.md), and [is powershell running as admin?](is_current_user_admin.md). 14 | 15 | Or if you want to know the [windows version, I've covered that too](../windows/which_version.md). 16 | 17 | ## Source 18 | 19 | * http://stackoverflow.com/questions/1825585/determine-installed-powershell-version 20 | 21 | -------------------------------------------------------------------------------- /concepts/expected_value.md: -------------------------------------------------------------------------------- 1 | # Expected Value 2 | 3 | Expected Value (EV) is how much you would expect to make, on average, if you repeated an experiment (or gamble) a large number of times. 4 | 5 | If you pay $1 for a one in five chance of winning $2, then the expected value is $0.40 and you might decline the offer. 6 | 7 | A gamble with an expected value of more than $1 per dollar is only worth taking if you can afford to take the loss. Russian roulette is an example of a game you shouldn't play regardless of the EV, because you can't afford to lose. 8 | 9 | Lottery generally has an expected value of less than the face value of the tickets. But in a jackpot scenario the EV is higher, and can be higher than the face value of the ticket. -------------------------------------------------------------------------------- /mercurial/ensure_all_files_added.md: -------------------------------------------------------------------------------- 1 | # Ensure all files are added before a commit 2 | 3 | In order to ensure all files have been added (or .hgignored) before going ahead with a commit, add the following pre-transaction commit hook to your [mercurial.ini](mercurial_ini.md) file 4 | 5 | 6 | [hooks] 7 | pretxncommit.add_all_files_first_please = hg stat | findstr "? " && EXIT /B 1 || EXIT /B 0 8 | 9 | But i've had to disable that because it fails if i have a local commit that added a file, which ["fetch"](current_extensions.md) is merging to an incoming commit that also added files. or something like that. 10 | 11 | ## See also 12 | 13 | * [The little known beauty of .ensure files](http://www.secretgeek.net/ensure) 14 | 15 | -------------------------------------------------------------------------------- /sql_server/create_schema_specific_role.md: -------------------------------------------------------------------------------- 1 | # Create a role that gives a user permissions on a specific schema. 2 | 3 | Creates a role named 'SpecificSchemaSuperPowers' 4 | 5 | That gives specific permissions (ALTER, DELETE, EXECUTE, INSERT, REFERENCES, SELECT, UPDATE, VIEW DEFINITION) on a specific schema 'SpecificSchema' 6 | 7 | (And adds a particular user (AD\BambrickL) to that role) 8 | 9 | as follows: 10 | 11 | CREATE ROLE SpecificSchemaSuperPowers AUTHORIZATION dbo; 12 | 13 | GRANT ALTER, DELETE, EXECUTE, INSERT, REFERENCES, SELECT, 14 | UPDATE, VIEW DEFINITION ON SCHEMA::SpecificSchema TO SpecificSchemaSuperPowers; 15 | 16 | EXEC sp_addrolemember 'SpecificSchemaSuperPowers', 'AD\BambrickL'; 17 | 18 | -------------------------------------------------------------------------------- /sql_server_reporting_services/reports_are_blank_in_chrome.md: -------------------------------------------------------------------------------- 1 | # SSRS reports are blank in Google Chrome 2 | 3 | Applies to: `SSRS 2008 r2` and `SSRS 2012` on Google Chrome 4 | 5 | Find `ReportingServices.css` on the server, it may be here for example: 6 | 7 | C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\Styles\ReportingServices.css 8 | 9 | Append this line: 10 | 11 | div#ctl31_ctl09,div#ctl31_ctl10{ overflow: visible !important;} 12 | 13 | The exact div id's may change over time, because The Struggle Is Real. 14 | 15 | 16 | ## Source 17 | 18 | * http://stackoverflow.com/questions/5428017/cannot-view-ssrs-2008-r2-ssrs-2012-reports-in-safari-chrome-but-works-fine-in 19 | 20 | -------------------------------------------------------------------------------- /html/autocomplete_dropdowns.md: -------------------------------------------------------------------------------- 1 | # HTML supports autocomplete-style dropdowns 2 | 3 | 4 | > HTML has native support for autocomplete-style dropdowns attached to inputs via the `` element. 5 | > 6 | > This input behaves like a ` 12 | 13 | 20 | 21 | 22 | See `list` points to id of `datalist`. -------------------------------------------------------------------------------- /reading_notes/Ariely_Payoff.md: -------------------------------------------------------------------------------- 1 | # Payoff: the hidden logic that shapes our motivations Dan Ariely 2 | 3 | 4 | 5 | 6 | 7 | Life calling, things larger than ourselves. 8 | 9 | 10 | 11 | People are more motivated when you acknowledge their work. 12 | 13 | 14 | 15 | People overvalue their own output (ie compared to how others value it) "egocentric bias" 16 | 17 | 18 | 19 | People care more when they can put their name on something. 20 | 21 | 22 | 23 | People value their output relative to the effort they've put in. 24 | 25 | 26 | 27 | People are demotivated when their output is destroyed before their eyes. 28 | 29 | 30 | 31 | People are demotivated when their output is ignored. 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /reading_notes/Duhigg_Habit.md: -------------------------------------------------------------------------------- 1 | # The power of habit Charles Duhigg 2 | 3 | 4 | 5 | **Trigger** 6 | 7 | Making coffee look out the window and see the pool is either green or has leaves in it or has leaves on top 8 | 9 | 10 | 11 | ** Action ** 12 | 13 | Think 🤔 I'd better clean it 14 | 15 | 16 | 17 | ** Reward ** 18 | 19 | None. Feel guilty for a moment then shake it off. 20 | 21 | 22 | 23 | Changed this to.... well I can't drink this coffee until I empty the baskets or measure the levels and add what's needed or whatever. 24 | 25 | 26 | 27 | People change product when major life changes occur. "A pillar of modern marketing" 28 | 29 | (That research may be about switching brands as much as anything) 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /mercurial/clone_without_cloning.md: -------------------------------------------------------------------------------- 1 | # clone without cloning 2 | 3 | Scenario: 4 | 5 | There are mercurial repositories housed on network shares. You want to clone them locally but you know: 6 | 7 | 1. It will take a while to do the initial clone 8 | 2. While the initial clone is happening, the repository will be locked 9 | 10 | So the alternative is to: 11 | 12 | Copy the repository to your local machine. Either by robocopy or any other method. 13 | 14 | robocopy X:\Repositories\MonoRepo C:\Repos\MonoRepo /MIR 15 | 16 | Then edit the `.hg/hgrc` file to refer to the remote location. 17 | 18 | You want the hgrc file to say something like this: 19 | 20 | [paths] 21 | default = X:\Repositories\MonoRepo 22 | 23 | i.e. to specify the remote path. -------------------------------------------------------------------------------- /graphics/showcard_gothic.md: -------------------------------------------------------------------------------- 1 | # Get Showcard Gothic 2 | 3 | Wondering why I don't have showcard gothic on my laptop I found it's because it comes with MS Office, which is not on my laptop. 4 | 5 | So I downloaded it from [fontzone: showcard-gothic](http://fontzone.net/download/showcard-gothic) and installed it (TTF file) 6 | 7 | And now my MS Paint explanations can have the correct font: 8 | 9 | ![showcard_gothic.png](showcard_gothic.png) 10 | 11 | Note: I first [checked the file at Virus Total](https://www.virustotal.com/en/file/80cd2486979c2c18f9dd59277c0fd800959afa1ce23820dcf7bce31f208647af/analysis/1487741390/). 12 | 13 | ## Source 14 | 15 | * [Microsoft Typography - Showcard Gothic](https://www.microsoft.com/typography/fonts/font.aspx?FMID=599) -------------------------------------------------------------------------------- /css/detect_retina_high_dpi_display.md: -------------------------------------------------------------------------------- 1 | # Detect retina display or high DPI display and send specific image 2 | 3 | 4 | 5 | @media 6 | only screen and (-webkit-min-device-pixel-ratio: 2), 7 | only screen and ( min--moz-device-pixel-ratio: 2), 8 | only screen and ( -o-min-device-pixel-ratio: 2/1), 9 | only screen and ( min-device-pixel-ratio: 2), 10 | only screen and ( min-resolution: 192dpi), 11 | only screen and ( min-resolution: 2dppx) { 12 | .hero { 13 | background:url("background@2x.png"); 14 | } 15 | } 16 | 17 | ## Source 18 | 19 | * [Stackoverflow: Retina display image resolution using media queries](https://stackoverflow.com/questions/37504520/retina-display-image-resolution-using-media-queries) -------------------------------------------------------------------------------- /git/discard_uncommitted_changes.md: -------------------------------------------------------------------------------- 1 | # Discard uncommitted changes 2 | 3 | You just realized the path you've been going down was not right and you want to: 4 | 5 | * Discard uncommitted changes 6 | * Some of which are on tracked files (files previously committed) and 7 | * Some of which may be on new files (files which are not tracked, have never been committed) and 8 | 9 | git stash 10 | git stash drop 11 | 12 | ^^ this will stash the changes to tracked files, and then lose them with drop. 13 | 14 | git clean -nd 15 | 16 | ^^ This will let you see the untracked files that would be deleted (including directories) 17 | 18 | If you're happy to lose the changes it lists then run: 19 | 20 | git clean -fd 21 | 22 | ^^ This will delete the untracked files -------------------------------------------------------------------------------- /mercurial/find_deleted_files.md: -------------------------------------------------------------------------------- 1 | # Find Deleted Files in Mercurial 2 | 3 | To find which revision a file was deleted in, use 4 | 5 | hg log --template "{rev}: {file_dels}\n" 6 | 7 | ...which outputs file deletion info from every revision. i.e. a list of every revision, and the names of any files that were deleted during that revision (if any) 8 | 9 | It looks like this: 10 | 11 | 12 | 388: 13 | 387: 14 | 386: TIL/.net-core-MVC/UrlEncode.md TIL/.net-core-MVC/UrlParameter-Optional.md TIL/.net-core-MVC/ip_address.md 15 | 385: 16 | 384: 17 | 383: 18 | 19 | Then you can grep those details to find the deleted file you're interested in, and see when it was deleted. 20 | 21 | You can then browse to the specific revision, via tortoise hg, `thg.exe`. 22 | 23 | -------------------------------------------------------------------------------- /.net_core_MVC/UrlParameter-Optional.md: -------------------------------------------------------------------------------- 1 | # What happened to UrlParameter.Optional ? 2 | 3 | instead of UrlParameter.Optional, you use the ? in the template to indicate an optional parameter 4 | 5 | e.g. instead of: 6 | 7 | routes.MapRoute( 8 | name: "Items", 9 | url: "items/{resource}", 10 | defaults: new { controller = "Root", action = "Items", resource = UrlParameter.Optional } 11 | ); 12 | 13 | simply.... 14 | 15 | 16 | routes.MapRoute( 17 | name: "Items", 18 | template: "items/{resource?}", 19 | defaults: new { controller = "Root", action = "Items" } 20 | ); 21 | 22 | 23 | 24 | ## Source 25 | 26 | * -------------------------------------------------------------------------------- /sql_server/datetime_trim_hours_milliseconds.md: -------------------------------------------------------------------------------- 1 | # Trim or zero-out a portion of a datetime.... 2 | 3 | 4 | To trim off the milliseconds.... (this was necessary when sending to XML for consumption by Excel...) 5 | 6 | DATEADD(ms, -DATEPART(ms, YourDate), YourDate) 7 | 8 | 9 | To trim off the entire time portion.... 10 | i.e. want just the date portion of a datetime? (dateonly) 11 | 12 | 13 | DATEADD(dd, 0, DATEDIFF(dd, 0, YourDate)) 14 | 15 | 16 | A function to do it for you.... 17 | 18 | CREATE FUNCTION dbo.JustDate(@date DATETIME) 19 | RETURNS DATETIME 20 | AS 21 | BEGIN 22 | RETURN DATEADD(dd, 0, DATEDIFF(dd, 0, @date)) 23 | END 24 | 25 | ## See also 26 | 27 | * [First (and last) day of the month.](first_day_of_month.md) -------------------------------------------------------------------------------- /vs_code/keystrokes_expand_collapse.md: -------------------------------------------------------------------------------- 1 | # Keystrokes to expand/collapse in VS Code 2 | 3 | Visual Studio Code Keystrokes to Expand/Collapse the current element/tag/region 4 | 5 | * `Ctrl Shift [` to collapse current element 6 | * `Ctrl Shift ]` to expand current element 7 | 8 | (also called Fold/Unfold, or "accordian" (verb), or zoom/unzoom) 9 | 10 | Visual Studio Code Keystrokes to Expand/Collapse all elements/tags/regions 11 | 12 | * Expand ALL: `Ctrl K` `Ctrl J` 13 | * Collapse ALL: `Ctrl K` `Ctrl 0` (Zero) 14 | 15 | ## Source 16 | 17 | * [How do I collapse sections of code in Visual Studio Code for Windows](https://stackoverflow.com/a/30077543/49) 18 | 19 | 20 | ## See also 21 | 22 | * [Expand/Collapse keystrokes in Notepad++](../notepad++/expand_collapse.md) -------------------------------------------------------------------------------- /.net/override_equals.md: -------------------------------------------------------------------------------- 1 | # override equals to compare objects 2 | 3 | If A and B are two different objects in memory, but they are of the same type and have all the same values... are they equal? 4 | 5 | It's a deep question, but if, for your problem domain, the answer is "YES" then you can embed this answer in your code as follows: 6 | 7 | 8 | 9 | public class MyThing 10 | { 11 | public string ID { get; set; } 12 | public decimal? Hats { get; set; } 13 | public decimal? Noses { get; set; } 14 | 15 | public override bool Equals(object obj) 16 | { 17 | Mything test = obj as Mything; 18 | if (obj == null) 19 | { 20 | return false; 21 | } 22 | return ID == test.ID && 23 | Hats == test.Hats && 24 | Noses == test.Noses; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /chocolatey/install_chocolatey.md: -------------------------------------------------------------------------------- 1 | # Install chocolatey (aka choco) 2 | 3 | From `cmd.exe` (with administrative rights) 4 | 5 | @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin 6 | 7 | 8 | Or, from powershell (with administrative rights): 9 | 10 | iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) 11 | 12 | 13 | After that, [choco commands](commands.md) should work. 14 | 15 | ## See Also 16 | 17 | To quickly launch cmd.exe or powershell with admin rights use [runas](../powershell/runas.md) — (kv runas) 18 | 19 | 20 | ## Links 21 | 22 | https://chocolatey.org/ 23 | -------------------------------------------------------------------------------- /mercurial/git_versus_hg_console_output.md: -------------------------------------------------------------------------------- 1 | # git messes up hg colors? and vice versa? 2 | 3 | if you use the "colors" extension in mercurial, you may find that the output of git is all messed up. 4 | 5 | i have these two functions: `git_on` and `git_off`. 6 | 7 | 8 | Run `git_on` when u want `git log` to work, `git_off` when you want `hg colors` to work. 9 | 10 | 11 | git_on -- stop git log from being bad, but ruin hg colors 12 | 13 | function git_on { 14 | $env:TERM="msys" # note that this is bad for hg colors, but good for git log! 15 | } 16 | 17 | git_off -- ruin git log, but stop hg colors from being bad 18 | 19 | function git_off { 20 | $env:TERM="" # note that this is bad for git log, but good for hg colors! 21 | } 22 | 23 | -------------------------------------------------------------------------------- /powershell/get_aduser.md: -------------------------------------------------------------------------------- 1 | # get-aduser is useful to set info about a user account 2 | 3 | TO see all of the properties of a user account (example account called "User1") 4 | 5 | get-aduser user1 -properties * 6 | 7 | Or to view specific properties: 8 | 9 | get-user user1 -propeties LockedOut, AccountLockoutTime 10 | 11 | Or to output it to CSV (perhaps to append to a log file...) 12 | 13 | 14 | get-aduser user1 -properties LockedOut, AccountLockoutTime | convertto-csv -notypeinformation 15 | 16 | If you *do* want to append it to a file then you'll want to skip the header row, e.g. 17 | 18 | get-aduser user1 -properties LockedOut, AccountLockoutTime | convertto-csv -notypeinformation | select -Skip 1 | Out-File $filenamestring -append 19 | 20 | But I digress. -------------------------------------------------------------------------------- /graphics/paint.net_select_single_pixel.md: -------------------------------------------------------------------------------- 1 | # Select single pixel 2 | 3 | To select a single pixel (if it's the same color as the pixels around it) zoom right in and use the rectangle select tool. 4 | 5 | Or if it's a different color to the pixels around it, use the Magic Wand. 6 | 7 | By why do you want to select it? 8 | 9 | To delete it? You can make it dissappear by drawing over it with a transparent color. Same result, right? To do this, choose a color with Alpha of 0 and then using the pencil tool to draw on top of it -- but here's the trick: change the 'overwrite' setting from "Normal blending" to "Overwrite". 10 | 11 | ## Source 12 | 13 | * [paint.net forum: easy single pixel selection](http://forums.getpaint.net/index.php?/topic/2408-easy-single-pixel-selection/) 14 | 15 | -------------------------------------------------------------------------------- /javascript/add_remove_class.md: -------------------------------------------------------------------------------- 1 | # add or remove a class 2 | 3 | We're going to look at all the elements with a class of cat, and then test for a class, remove a class, and add a class. 4 | 5 | Everything you need to do with a class. Pretty much. 6 | 7 | for(const cat of $(".cat")) { 8 | if (cat.classList.contains('fleas')) { 9 | // The cat has the fleas class... remove it 10 | this.classList.remove('fleas'); 11 | this.classList.add('clean'); 12 | } 13 | } 14 | 15 | 16 | 17 | (I just noticed that this example uses a little helper function I keep handy...) 18 | 19 | 20 | function $(selector) { 21 | return document.querySelectorAll(selector); 22 | } 23 | 24 | ...and similarly I use: 25 | 26 | function $id(id) { 27 | return document.getElementById(id); 28 | } 29 | 30 | ) -------------------------------------------------------------------------------- /mercurial/log_template.md: -------------------------------------------------------------------------------- 1 | # Log with template 2 | 3 | You can use templates with hg log, for example: 4 | 5 | hg log --template "{date|shortdate},{desc},{author|person}\n" -l 30 6 | 7 | Date and shortdate here are a keyword (date) that is piped to a filter (shortdate). 8 | 9 | Author usually contains name followed by email. So the person filter gets just the name. The email filter would get the email. 10 | 11 | i use this function, `hgl`, a lot 12 | 13 | function hgl() { 14 | hg log --template "{date|shortdate},{desc}\n" -l 30 15 | } 16 | 17 | Templates and Styles work with all "log-like" commands: 18 | 19 | * log 20 | * outgoing 21 | * incoming 22 | * tip 23 | * parents 24 | * heads 25 | * glog 26 | 27 | 28 | 29 | ## See also 30 | 31 | hg help template -------------------------------------------------------------------------------- /mercurial/mercurial_ini.md: -------------------------------------------------------------------------------- 1 | # mercurial.ini -- home of mercurial's config. 2 | 3 | (or on non-windows machines, your `.hgrc` file.) 4 | 5 | Your `mercurial.ini` file is located here: 6 | 7 | %userprofile%\mercurial.ini 8 | 9 | (If you don't have a file at `%userprofile%\mercurial.ini` then create one now) 10 | 11 | In powershell, you would edit: 12 | 13 | $env:userprofile\mercurial.ini 14 | 15 | 16 | (In recent versions of mercurial) You can edit it with this command: 17 | 18 | hg config --edit 19 | 20 | To edit the config of a single repo, look for the `.hg\hgrc` file. 21 | 22 | 23 | When running powershell as an admin you may not have a `$env:userprofile` at all. If you're intending to run mercurial as a non-admin this is not an issue. Just restart powershell as a mortal user. -------------------------------------------------------------------------------- /macbook_air/bluetooth_controller.md: -------------------------------------------------------------------------------- 1 | # No bluetooth in Settings -> Devices 2 | 3 | And bluetooth generally not present anywhere on the machine. 4 | 5 | In device manager: 6 | 7 | Other devices -> "Bluetooth USB Host Controller" has a warning icon. And there was no info about the device. 8 | No manufacturer etc. 9 | 10 | Trick was to update the drivers and then point it at the "AppleBluetoothBroadcom64" folder -- which I already had from previous times I faced this issue. 11 | 12 | Previously I have downloaded all of the BootCamp drivers, and unzipped them to here: 13 | 14 | 15 | C:\Users\Leon\Downloads\BootCamp5.1.5640\$WinPEDriver$\AppleBluetoothBroadcom64 16 | 17 | So I updated the drivers and browsed to that location. 18 | 19 | Then it believed that bluetooth was A-OK again. 20 | 21 | -------------------------------------------------------------------------------- /powershell/custom_objects.md: -------------------------------------------------------------------------------- 1 | # Create custom objects. 2 | 3 | Say you have two variables, `$name` and `$count` -- and you want to create a custom object that contains just those two properies.... 4 | 5 | $myObject = New-Object psobject -property @{name = $name; count = $count} 6 | 7 | Or say you are in a pipeline, within which `$name` and `$count` become available... you want to pipe out a custom object with those two properties... 8 | 9 | 10 | | % { 11 | $name = $_.FullPath 12 | $count = $_.Length 13 | # ^^ just for example 14 | 15 | New-Object psobject -property @{name = $name; count = $count} 16 | 17 | # ^^ Return our custom object... for the next actor in the pipeline to deal with... 18 | 19 | } | ConvertTo-CSV -NoTypeInformation | out-file "Name_And_Count.csv" -------------------------------------------------------------------------------- /linux/count_files_recursively.md: -------------------------------------------------------------------------------- 1 | # count all files in a directory, recursively 2 | 3 | Count files in current folder not recursive: 4 | 5 | ls -1 | wc -l 6 | 7 | Count files only: 8 | 9 | find . -type f | wc -l 10 | 11 | Count files and directories: 12 | 13 | find . | wc -l 14 | 15 | Count directories only: 16 | 17 | find . -type d | wc -l 18 | 19 | 20 | 21 | Now look at this: 22 | 23 | ~/.nuget$ find . -type f | wc -l 24 | 5259 25 | ~/.nuget$ find . | wc -l 26 | 10182 27 | 28 | The .nuget folder has 5259 files. Even worse... it has almost as many directories as folders! 29 | 30 | 31 | 32 | 33 | ## Source 34 | 35 | * [Recursively count all the files in a directory](http://superuser.com/questions/198817/recursively-count-all-the-files-in-a-directory) -------------------------------------------------------------------------------- /sleep/why_sleep.md: -------------------------------------------------------------------------------- 1 | # Problems arising from lack of sleep 2 | 3 | By lack of sleep, I mean < 8 hours. 4 | 5 | ## Body 6 | 7 | * Heart disease 8 | * Cancer 9 | * Diabetes 10 | * weight gain 11 | * immune system 12 | * infection 13 | * recovery 14 | * shortened life span 15 | * everything else imaginable, basically 16 | 17 | 18 | ## Mind 19 | 20 | > Going short of sleep is like forgetting to save a document you've worked on all day. 21 | >
—Caroline Webb (How to have a good day) 22 | 23 | 24 | * Poor memory 25 | * Poor creativity 26 | * Lowered alertness 27 | * Alzheimer's 28 | * Many other neurological conditions 29 | * Everything else imaginable, basically 30 | 31 | 32 | 33 | ## Source 34 | 35 | As seen in the book "Why We Sleep" by Matthew Walker. (I can't recommend this book highly enough) 36 | -------------------------------------------------------------------------------- /gitbook/add_google_analytics_to_gitbook.md: -------------------------------------------------------------------------------- 1 | # Add Google Analytics to gitbook 2 | 3 | npm install gitbook-plugin-ga 4 | 5 | In the file `book.json` (which you may need to create) -- 6 | 7 | You can set the Google Analytics tracking ID using the plugins configuration in the `book.json`: 8 | 9 | { 10 | "plugins": ["ga"], 11 | "pluginsConfig": { 12 | "ga": { 13 | "token": "UA-XXXX-Y" 14 | } 15 | } 16 | } 17 | 18 | There is also traffic reporting at gitbook (assuming you've published your book that way) 19 | 20 | 21 | ## Source 22 | 23 | * https://www.npmjs.com/package/gitbook-plugin-ga 24 | 25 | ## See Also 26 | * [npm](../npm/01_summary.md) 27 | * [Add a new site to track in Google Analytics](../google/google_analytics_add_new_site.md) 28 | -------------------------------------------------------------------------------- /mercurial/push_rainbow.md: -------------------------------------------------------------------------------- 1 | # hg push to bitbucket resulted in a rainbow 2 | 3 | ![hg_push_resulted_in_this.png](hg_push_resulted_in_this.png) 4 | 5 | This had me completely stumped. What does it mean? 6 | 7 | Has bitbucket been hacked? Is my repo corrupted? 8 | 9 | After extensive googling I worked out it's an Atlassian logo (atlassian bought bitbucket a few years ago) drawn in rainbow colors, to celebrate equality, on the anniversary of the US Supreme Court's decision to strike down laws against gay marriage. 10 | 11 | I wish there'd been a few words, or even a url included. A picture is worth a thousand words, but a few words can be helpful too. 12 | 13 | 14 | ## References 15 | 16 | * [Atlassian "logo" after pushing to bitbucket](https://stackoverflow.com/questions/31081919/atlassian-logo-after-pushing-to-bitbucket) -------------------------------------------------------------------------------- /powershell/create_profile.md: -------------------------------------------------------------------------------- 1 | # Create profile 2 | 3 | To test if your profile exists, use this command... 4 | 5 | test-path $PROFILE 6 | 7 | To create your profile file (and create a folder to stick it in), use this command: 8 | 9 | New-Item -path $profile -type file -force 10 | 11 | * `-path $profile` -- We pass in the full path of the item we want to create, (from the `$profile` variable). 12 | * `-type file` -- We tell New-Item that we want to create a file. 13 | * `-force` -- We tell New-Item to 'just do it' (and in this case it might mean creating the directory to put the file in!) 14 | 15 | 16 | Now you can edit your profile and start putting all the good things in. 17 | 18 | 19 | ## See Also 20 | 21 | * [In powershell you don't have 1 profile, you have 4 different ones.](profile_4_different_ones.md) -------------------------------------------------------------------------------- /.net_core_MVC/server_mappath.md: -------------------------------------------------------------------------------- 1 | # Server.MapPath 2 | 3 | Well well well. This was certainly a fun thing to do back in the good old days wasn't it now: 4 | 5 | HttpContext.Current.Server.MapPath("~/") 6 | 7 | But we don't does that no more, does we now. 8 | 9 | Instead we injects a hosting environment... 10 | 11 | private readonly IHostingEnvironment _hostingEnvironment; 12 | 13 | public MyController(IHostingEnvironment hostingEnvironment) 14 | { 15 | _hostingEnvironment = hostingEnvironment; 16 | } 17 | 18 | ...which uses: 19 | 20 | using Microsoft.AspNetCore.Hosting; 21 | 22 | Then in our method we can very simply say: 23 | 24 | 25 | var rootPath = _hostingEnvironment.WebRootPath; 26 | var parentPath = Directory.GetParent(rootPath).FullName; 27 | 28 | 29 | -------------------------------------------------------------------------------- /stackexchange/closed_questions_with_Given_Tags.md: -------------------------------------------------------------------------------- 1 | # Closed, Off topic questions with specific tags 2 | 3 | 4 | Select 5 | distinct 6 | p.Id 7 | from Posts p 8 | inner join PostHistory ph on ph.PostId = p.Id 9 | inner join PostHistoryTypes pht on ph.PostHistoryTypeId = pht.Id 10 | inner join PostTags pt on p.ID = pt.PostId 11 | inner join Tags t on pt.TagId = t.Id 12 | and (t.TagName like 'c#' 13 | or t.TagName like 'asp.net%' 14 | or t.tagName like 'powershell' 15 | or t.TagName like 'sql-server%' 16 | or t.TagName like 'excel%' 17 | or t.TagName like 'csv%') 18 | where 19 | p.ClosedDate is not null 20 | and pht.Name = 'Post Closed' 21 | and ph.Comment = '102' -- Off topic 22 | and p.CreationDate > '01 Jan 2016' 23 | order by p.id desc -------------------------------------------------------------------------------- /powershell/Test_Path.md: -------------------------------------------------------------------------------- 1 | # Test-Path is how you check if a file exists 2 | 3 | > Test-Path Test_Path.md 4 | true 5 | 6 | Easy, right. 7 | 8 | > Test-Path .\Test_Path.md 9 | true 10 | 11 | 12 | Let's check for two files.... 13 | 14 | 15 | > Test-Path .\Test_Path.md -and Test-Path .\histogram.md 16 | Test-Path : A parameter cannot be found that matches parameter name 'and'. 17 | 18 | 19 | No, that's not right, here's how you test for two paths: 20 | 21 | 22 | > (Test-Path .\Test_Path.md) -and (Test-Path .\histogram.md) 23 | true 24 | 25 | 26 | And how do we test for the existence of a folder/directory, with the "PathType" Container... 27 | 28 | 29 | > test-path readme.md -PathType Container 30 | false 31 | 32 | > test-path MyFiles -PathType Container 33 | true 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /python/grip.md: -------------------------------------------------------------------------------- 1 | # The easy way to serve a markdown file in the browser 2 | 3 | pip install grip 4 | grip markdown.md 5 | 6 | 7 | Will serve your file at `localhost:xxx` (some port number) 8 | 9 | And if/when you modify the file, the page will automatically refresh! 10 | 11 | Wonderful stuff. 12 | 13 | This problem comes up a lot for me though: 14 | 15 | LookupError: unknown encoding: cp65001 16 | Logged from file _internal.py, line 87 17 | 18 | And this solution from stackoverflow seems to help: 19 | 20 | set PYTHONIOENCODING=utf-8 21 | 22 | Or in powershell-ese... 23 | 24 | 25 | 26 | $env:PYTHONIOENCODING = "utf-8" 27 | 28 | 29 | 30 | ## Source 31 | 32 | * [Python: Emit some Utf-8 string to windows console](http://stackoverflow.com/questions/10321611/python-emit-some-utf-8-string-to-windows-console) -------------------------------------------------------------------------------- /google/google_analytics_add_new_site.md: -------------------------------------------------------------------------------- 1 | # Add a new site to track in Google Analytics 2 | 3 | Click **Admin** in the top menu 4 | 5 | > Account -> Property -> view 6 | 7 | if it's a new subdomain of a domain you already track 8 | 9 | * pick the account (i.e. domain) and for property: "new property" (you get 50 of these per accoutn) 10 | 11 | Or for a whole new domain: 12 | 13 | * under Admin -> Account "Create new account" (you get 100 of these) 14 | 15 | When adding the new view, it will default the name to "All Website Data" but instead name it after your exact subdomain. 16 | 17 | May also want to add it in 'Google Search Console' (formerly 'Google Webmaster Tools') 18 | 19 | //TODO: add site in Google Search Console 20 | 21 | ## See also 22 | 23 | * [Add Google Analytics to gitbook](../gitbook/add_google_analytics_to_gitbook.md) -------------------------------------------------------------------------------- /powershell/who_is_using_each_port.md: -------------------------------------------------------------------------------- 1 | # Who is using each port? 2 | 3 | To see if a port is in use, and by which process, use this command: 4 | 5 | > netstat -ano 6 | 7 | To filter for a particular port, e.g. 5060 8 | 9 | > netstat -ano | select-string 5060 10 | TCP 0.0.0.0:5060 0.0.0.0:0 LISTENING 15264 11 | UDP 0.0.0.0:5060 *:* 15264 12 | 13 | 14 | To see the details of that process id (pid) -- use the famous get-process, as seen in every powershell example ever... 15 | 16 | > get-process -Id 15264 17 | 18 | Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName 19 | ------- ------ ----- ----- ----- ------ -- ----------- 20 | 1079 149 109644 104552 526 30.50 15264 LyncAddOn 21 | -------------------------------------------------------------------------------- /go/install_go_on_windows_bash.md: -------------------------------------------------------------------------------- 1 | # Install go on windows bash 2 | 3 | I wanted to run some go tools in bash -- so i needed to install go. 4 | 5 | I used this tutorial: 6 | 7 | ## [Go installer for Bash on Windows](https://stefanprodan.com/2016/golang-bash-on-windows-installer/) 8 | 9 | Wherein you basically do this: 10 | 11 | cd $HOME 12 | curl -s -L https://gist.githubusercontent.com/stefanprodan/29d738c3049a8714297a9bdd8353f31c/raw/1f3ae2cf97cb2faff52a8a3d98f0b6415d86c810/win10-bash-go-install.sh | sudo bash 13 | 14 | (I actually downloaded it into a file and ran the file with `sudo bash installgo.sh`) 15 | 16 | Then I had to **restart bash** before `which go` would admit that go was installed. 17 | 18 | ## External references 19 | 20 | * [Go installer for Bash on Windows](https://stefanprodan.com/2016/golang-bash-on-windows-installer/) -------------------------------------------------------------------------------- /sql_server/start_time.md: -------------------------------------------------------------------------------- 1 | # When was SQL Server restarted? 2 | 3 | 4 | Mohammad Nizamuddin provides 4 different queries to find when the server was started, the first login occurred, the `tempdbs` were created. 5 | 6 | 7 | --SELECT sqlserver_start_time FROM sys.dm_os_sys_info; --I didn't have permissions for this one 8 | SELECT login_time FROM sys.dm_exec_sessions WHERE session_id = 1; --this returned nothing for session_id = 1, for me 9 | SELECT crdate FROM master..sysdatabases WHERE name='tempdb' ; 10 | SELECT create_date FROM sys.databases WHERE name = 'tempdb' ; 11 | --select start_time from sys.traces where is_default = 1 ; --I didn't have permissions for this one 12 | 13 | 14 | ## Source 15 | 16 | * [Script to check when was SQL Server restarted](https://gallery.technet.microsoft.com/scriptcenter/Script-to-check-when-was-5d0fe4e8) -------------------------------------------------------------------------------- /sql_server/trailing_cr_lf.md: -------------------------------------------------------------------------------- 1 | # Trailing Cr Lf 2 | 3 | Trailing Carriage return (\r) and Linefeed (\n) in a varchar are really hard to detect in SSMS. 4 | 5 | 6 | Imagine there's three columns, A, B and C that have the same content except B has two trailing spaces and C has a trailing '\r\n'. 7 | 8 | Select A,B,C from Table 9 | 10 | 11 | In SSMS the grid will silently turn the '\r\n' into two spaces. 12 | 13 | So it will look like B and C both have two trailing spaces. 14 | 15 | 16 | If you compare A=B it will return `true` (because 'A' == 'A ' according to SQL) 17 | 18 | If you compare B=C (or A=C) it will return 'false' -- even though A and B will both look (in the grid) like they have trailing spaces. 19 | 20 | If you switch the output to text mode, the carriage return line feed will be retained. 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /mercurial/current_extensions.md: -------------------------------------------------------------------------------- 1 | # Current extensions 2 | 3 | ...that are enabled in my [mercurial.ini](mercurial_ini.md) file right now 4 | 5 | [extensions] 6 | color = 7 | fetch = 8 | graphlog = 9 | extdiff = 10 | hgext.extdiff = 11 | helloworld = C:\Program Files\TortoiseHg\hgext\helloworld.py 12 | patience = C:\Program Files\TortoiseHg\hgext\patience.py 13 | timetracker = C:\Program Files\TortoiseHg\hgext\timetracker.py 14 | rebase = 15 | versions = C:\Program Files\TortoiseHg\hgext\versions.py 16 | wincolor = C:\Program Files\TortoiseHg\hgext\wincolor.py 17 | zipdoc = C:\Program Files\TortoiseHg\hgext\zipdoc.py 18 | 19 | 20 | Not even sure what all of these do. 21 | 22 | Some are left over from when I was playing with [writing mercurial extensions](http://www.secretgeek.net/mercurial_extensions) -------------------------------------------------------------------------------- /powershell/replace_a_line_in_a_file.md: -------------------------------------------------------------------------------- 1 | # Replace a line in a file 2 | 3 | This is a common admin task. You might need to replace the publishing date, or the copyright year, or the author's name or some other piece of information. How to replace it... Like so: 4 | 5 | 6 | $targetFile = 'FileName.ps1' 7 | $regex = '^This is the old line$"' 8 | $with = "This is the new line" 9 | (Get-Content $targetFile) -replace $regex, $hashyLine | Set-Content $targetFile 10 | 11 | Unexplored edge cases... what happens to the encoding? What if you want to replace one thing many times on a single line? What if it's not the whole line, etc. What if you only want to do the replace on the first match, or on the last match? 12 | 13 | ## See also 14 | 15 | * [Giving Chocolatey a Checksum when creating a package](../chocolatey/specify_checksum_for_chocolatey.md) -------------------------------------------------------------------------------- /music/scales_and_emotions.md: -------------------------------------------------------------------------------- 1 | # Scales and emotions 2 | 3 | The simplistic version we're told is: 4 | 5 | A song in a major scale is happy, a song in a minor scale is sad. 6 | 7 | While there's some truth to that, there's also a lot more to it. 8 | 9 | First, a more accurate claim would be: 10 | 11 | * A fast song in a major scale is happy. 12 | * A slow song in a major scale is sentimental. 13 | * A slow song in a minor scale is sad. 14 | * A fast song in a minor scale is angry. 15 | 16 | That's pretty profound stuff! 17 | 18 | Here's a depiction of those four quadrants: 19 | 20 | ![quadrants](quadrants.png) 21 | 22 | 23 | 24 | 25 | Here's my source, an excellent guide! 26 | 27 | ## Source 28 | 29 | * [Scales and Emotions](http://www.ethanhein.com/wp/2010/scales-and-emotions/) 30 | 31 | 32 | ## See also 33 | 34 | * [Guitar Dashboard](/Help/guitar_dashboard.md) -------------------------------------------------------------------------------- /powershell/find_text.md: -------------------------------------------------------------------------------- 1 | # Find text (from powershell) 2 | 3 | Use `Select-String` (alias `sls`) and -Pattern (patt) 4 | 5 | sls *.md -patt "hack:" 6 | 7 | Need to look recursively, then pipe in the locations from `dir` (`Get-ChildItem`)... 8 | 9 | dir -Path . *.md -Recurse | sls -patt "hack:" 10 | 11 | Need to look at multiple file types, use include: 12 | 13 | dir -Path . -Include *.md,*.txt,*.cs,*.cshtml,*.css,*.js -Recurse | sls -patt "hack:" 14 | 15 | 16 | Some custom formatting out of the output, example 17 | 18 | sls *.md -patt "hack:" | ft -property FileName, Line -autosize | more 19 | 20 | 21 | If the pattern is not a regex, and just a simple string, use "-SimpleMatch" (also useful if you want a simple match for some weird text that looks like a malformed regex, as in this example) 22 | 23 | sls *.md -patt "](" -SimpleMatch 24 | 25 | -------------------------------------------------------------------------------- /minecraft/commands.md: -------------------------------------------------------------------------------- 1 | # Awesome fun commands for use in minecraft 2 | 3 | There's no better command... 4 | 5 | /summon Chicken ~ ~ ~ {Passengers:[{id:Zombie,IsBaby:1}]} 6 | 7 | Set the time to dawn: 8 | 9 | /time set 0 10 | 11 | Note: 12 | 13 | > 0 for dawn, 6000 for midday, 12000 for dusk and 18000 for night. 14 | 15 | 16 | Make sure that if you die you don't lose your inventory with: 17 | 18 | /gamerule keepInventory true 19 | 20 | /cannon 21 | 22 | ...launches TNT where you are pointing. 23 | 24 | 25 | # Teleport 26 | 27 | /tp ~ ~ ~ 28 | 29 | ^^ This returns your current location 30 | 31 | /tp x y z 32 | 33 | (Where x y and z are values) will take you somewhere. 34 | 35 | 36 | # give yourself a command block 37 | 38 | /give @s command_block 39 | 40 | ## External 41 | 42 | * 43 | -------------------------------------------------------------------------------- /education/links.md: -------------------------------------------------------------------------------- 1 | # Some Links about Education 2 | 3 | * The What Works Clearinghouse https://ies.ed.gov/ncee/wwc/ 4 | * [SciLearn](https://www.scilearn.com/resources/infographics-posters/reading-fluency-launching-way-to-comprehension), as mentioned in "The Brain that Changes Itself" (regarding their Fast ForWord programme) also [differences in language development](https://www.scilearn.com/differences-in-language-development) and [inside the brain of a struggling reader](https://www.scilearn.com/resources/infographics-posters/inside-the-brain-of-a-struggling-reader) 5 | * Also from "The Brain that Changes Itself" is [brain hq](https://www.brainhq.com/?v4=true&fr=y) 6 | * [Twinkl](https://www.twinkl.com.au/resources/australian-resources) helps you teach 7 | * [Twinkl Australian Curriculum browser](https://www.twinkl.com.au/resources/australian-resources-australian-curriculum-browser) 8 | 9 | -------------------------------------------------------------------------------- /git/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # git 3 | ### chapter contents 4 | 5 | * [access github behind corporate proxy](access_github_behind_corporate_proxy.md) 6 | * [alias](alias.md) 7 | * [cheatsheet](cheatsheet.md) 8 | * [delete old branches](delete_old_branches.md) 9 | * [diff](diff.md) 10 | * [discard uncommitted changes](discard_uncommitted_changes.md) 11 | * [equivalent of outgoing](equivalent_of_outgoing.md) 12 | * [get fork back up to date](get_fork_back_up_to_date.md) 13 | * [git bitbucket](git_bitbucket.md) 14 | * [git config](git_config.md) 15 | * [git for mercurial users](git_for_mercurial_users.md) 16 | * [git timedout corporate vpn](git_timedout_corporate_vpn.md) 17 | * [merge pull request](merge_pull_request.md) 18 | * [remove from git but keep locally](remove_from_git_but_keep_locally.md) 19 | * [see git folder](see_git_folder.md) 20 | * [stash](stash.md) 21 | * [version](version.md) 22 | -------------------------------------------------------------------------------- /music/take_it_slow.md: -------------------------------------------------------------------------------- 1 | # Take it slow 2 | 3 | When learning a new riff or other piece of music **take it slow**. 4 | 5 | You should go so slowly that you play the right note every time — even if that means going painfully painfully slow. 6 | 7 | The slower you go at first the faster you'll be able to go later. 8 | 9 | As you begin to play a piece, you are programming your fingers, your "muscle memory" to be able to play that piece. If you play too fast and make even small mistakes, then you will begin to program those mistakes into your muscle memory. You'll find it impossible to avoid those same mistakes at faster speeds! So go slow... extra slow... really slow. 10 | 11 | This is a rephrasing of the concept that music teachers bang on about: "practice makes permanent" (not that I've ever had a music teacher... I just hear about them). Allegedly basketball coaches also say this. -------------------------------------------------------------------------------- /security_virus_spam_etc/virus_total.md: -------------------------------------------------------------------------------- 1 | # Is your product being flagged as a virus/malware 2 | 3 | If anyone is reporting that your product is a virus, then virus total will know about it 4 | 5 | https://www.virustotal.com/ 6 | 7 | One company was flagging NimbleText as a virus. I found out who via Virus Total. 8 | 9 | I emailed them (the problem company, not virus total) and they corrected the issue within a day. 10 | 11 | Here's a page that lists how to contact a large number of Antivirus vendors: 12 | 13 | [How to Report False Positives to Antivirus Vendors](http://www.virus-removal-help.com/how-to-report-false-positives-to-antivirus-vendors/) 14 | 15 | "Rising" was particularly hard to track down. I found this page: http://mailcenter.rising.com.cn/filecheck_en/ 16 | 17 | 18 | If your webpage is flagged as containing malware that's a different problem. See Google Search Console tip. -------------------------------------------------------------------------------- /visual_studio/html_surround_with.md: -------------------------------------------------------------------------------- 1 | # Surround WIth 2 | 3 | 4 | > If you have Web Essentials installed, you can use Shift+Alt+W to surround a selection with a tag. 5 | 6 | See http://vswebessentials.com/features/html#surround-with 7 | 8 | 9 | The poor person's "surround with", when you don't have web essentials. 10 | 11 | 1. Select your text 12 | 2. Press Ctrl-X to cut it to clipboard 13 | 3. Type your tag, which Visual Studio will automatically close with your cursor remaining in the middle of the start and end tag 14 | 4. Press Ctrl-V to re-insert your text between the tags 15 | 16 | --http://stackoverflow.com/a/35178430/49 17 | 18 | 19 | ## Source 20 | 21 | * http://stackoverflow.com/questions/191463/how-do-i-wrap-a-selection-with-an-html-tag-in-visual-studio 22 | * http://vswebessentials.com/features/html#surround-with 23 | * http://stackoverflow.com/a/35178430/49 24 | -------------------------------------------------------------------------------- /oracle/instant_client.md: -------------------------------------------------------------------------------- 1 | # Oracle instant client 2 | 3 | To use this with Orable (my dodgy Oracle Query IDE) I need to download the Oracle Instant Client (32 bit) from here: 4 | 5 | http://www.oracle.com/technetwork/topics/winsoft-085727.html 6 | 7 | You need to provide login credentials to Oracle, so they've got that now, darn them. 8 | 9 | Download it, unzip it to somewhere that all users on your machine can access it. 10 | 11 | Then add it's location to your PATH. 12 | 13 | e.g. I just added this to my path 14 | 15 | ;C:\wip\Oracle\instantclient-basic-nt-12.1.0.2.0\instantclient_12_1 16 | 17 | I think needed to restart Orable (infact I had to restart the instance of visual studio that launched Orable) 18 | 19 | ## See also 20 | 21 | * [..\Powershell\PATH.md](Path) 22 | * [Environment variables -- view/edit them on windows](../windows/environment_variables.md) 23 | 24 | -------------------------------------------------------------------------------- /sql_server/table_re_creation.md: -------------------------------------------------------------------------------- 1 | # Prevent saving changes that require the table to be re-created. 2 | 3 | You are modifying a table, using `Design table` in SSMS, and want to generate a change script (or maybe you want to save your change) 4 | 5 | 6 | 7 | Table Designer → Generate Change Script 8 | 9 | 10 | Sql Server Management Studio (SSMS) produces this error: 11 | 12 | 13 | > Saving changes is not permitted. The changes you have made require the following changes to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled te option Prevent saving changes that require the table to be re-created. 14 | 15 | 16 | Oh no! 17 | 18 | To enable this option, go to: 19 | 20 | 21 | 22 | Tools → Options → Designers → Table and Database Designers → Table Options 23 | 24 | Prevent saving changes that require table re-creation -------------------------------------------------------------------------------- /gitbook/host_on_custom_subdomain.md: -------------------------------------------------------------------------------- 1 | # Host a gitbook on a custom subdomain 2 | 3 | (e.g. http://TIL.secretGeek.net) 4 | 5 | By default the book is hosted on http://{author}.gitbooks.io/{book}/ 6 | and can be read at https://www.gitbook.com/read/book/{author}/{book} 7 | 8 | If you want to host it on a custom sub domain then you may need to add a `cname` record at your webhost. 9 | 10 | 11 | 12 | 13 | Then, at gitbook.com tell it the custom domain. 14 | 15 | * Settings -> 16 | * Domains -> 17 | * Custom domains -> 18 | * For content: TIL.secretGeek.net 19 | 20 | ## Source 21 | 22 | * https://help.gitbook.com/platform/domains.html 23 | 24 | ## See Also 25 | 26 | * [Getting started with gitbook](getting_started_with_gitbook.md) 27 | * [To have your gitbook updated whenever you push to a github repo](web_hooks.md) 28 | * [Use gitbook locally](use_gitbook_locally.md) 29 | 30 | -------------------------------------------------------------------------------- /reading_notes/Cialdini_influence.md: -------------------------------------------------------------------------------- 1 | # Influence - Robert Cialdini 2 | 3 | 6 fixed action patterns "click, whir" 4 | 5 | * Reciprocity 6 | * Commitment and consistency 7 | * Proof 8 | * Liking 9 | * Authority 10 | * Scarcity 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | There is no expedient to which a man will not resort to avoid the real labor of thinking. 23 | 24 | --Sir Joshua Reynolds 25 | 26 | 27 | 28 | 29 | 30 | Commitments should be active public and effortful. 31 | 32 | 33 | 34 | Jigsaw teaching techniques for racial integration of classroom or for getting groups that were formerly enemies combative to work together increase harmony. A first step. Deserves more attention. I love that it integrates social encoding advantage and student as teacher and social skill development as well. Super useful. 35 | 36 | (But which book was this covered in??) 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /concepts/follow_up_and_recurring_emails.md: -------------------------------------------------------------------------------- 1 | # Follow up and recurring emails 2 | 3 | Use: 4 | 5 | http://FollowupThen.com 6 | 7 | 8 | 9 | Send an email to, for example: 10 | 11 | Daily1800@followupthen.com 12 | 13 | And the email you send will be sent back to you at 6pm each day (including instructions on how to cancel or edit the recurring reminder) 14 | 15 | other examples: 16 | 17 | 1minute@followupthen.com 18 | 19 | Will email you back in 1 minute... 20 | 21 | Also: 22 | 23 | 2hours 24 | 3days 25 | 4weeks 26 | 5months 27 | 6years 28 | 29 | Follows up on the next occurrence of the specified time. 30 | 31 | 11am 32 | 1132am 33 | 1630 34 | 1500 35 | mar30 36 | 22april 37 | 1Jan2014 38 | 9amSept14th2015 39 | 40 | ## Source 41 | 42 | * [https://www.followupthen.com/how](https://www.followupthen.com/how) -------------------------------------------------------------------------------- /asp.net_mvc/helpful_error_page.md: -------------------------------------------------------------------------------- 1 | # Making a custom error page helpful for developers 2 | 3 | Sometimes (for apps on an intranet), on the custom error page I put something like this: 4 | 5 | 6 | @model System.Web.Mvc.HandleErrorInfo 7 | 8 | @if (Model != null) 9 | { 10 |

@Model.Exception.GetType().Name
11 | thrown in @Model.ControllerName @Model.ActionName

12 |

Error Details:

13 |

@Model.Exception.Message

14 | } 15 | 16 | 17 | Since you're leaking details to the outside world I don't recommend it for all sites. Can also make sure it's only shown to some users. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | I use Elmah.axd to log errors. See [elmah](/elmah.md) — make sure it's secure! 26 | 27 | -------------------------------------------------------------------------------- /excel/if_error.md: -------------------------------------------------------------------------------- 1 | # Avoid `#VALUE!` with IFERROR 2 | 3 | Sick of you carefully crafted excel formula resulted in `#VALUE!` for all the edge cases you don't care about? 4 | 5 | Just wrap your formula in an IFERROR function..... 6 | 7 | e.g. here's a formula for grabbing everything before the first comma.... 8 | 9 | =LEFT(B3, FIND(",", B3)-1) 10 | 11 | ...but what happens when there is no comma!? A dirty great error that's what! 12 | 13 | So wrap it in an `IFERROR` instead my smooth friend: 14 | 15 | =IFERROR(LEFT(B3, FIND(",", B3)-1),"") 16 | 17 | Arh! That better! 18 | 19 | And for completeness, here's a sneaky formula to get everything after the first space... 20 | 21 | =IFERROR(TRIM(MID(C2 & REPT(" ", 100), FIND(" ", C2), 50)),"") 22 | 23 | 24 | ## Sources 25 | 26 | * [Excel Formula: Split text with delimiter](https://exceljet.net/formula/split-text-with-delimiter) — some nice examples here 27 | -------------------------------------------------------------------------------- /.net_core_MVC/error_in_g_cs.md: -------------------------------------------------------------------------------- 1 | # Error in Razor\Views\...\*.g.cshtml.cs page 2 | 3 | Sometimes, particularly after upgrading from one .net core verison to another I see errors in `g.cshtml.cs` pages... 4 | 5 | 6 | Severity Code Description Project File Line Suppression State 7 | Error CS0246 The type or namespace name 'VerifyCodeViewModel' could not be found (are you missing a using directive or an assembly reference?) mysite C:\apps\websites\mysite\obj\Debug\netcoreapp2.1\Razor\Views\Account\VerifyCode.g.cshtml.cs 23 Active 8 | 9 | I can never remember what to do. 10 | 11 | The trick is to go and look at the `cshtml` file (the razor view itself) that the `.cs` file is compiled from. 12 | 13 | There will be an error and it will be evident in the cshtml file itself. 14 | 15 | For some of them the error was that I had to add another `@using` statement to the `_ViewImports.cshtml` file. But it could be anything. 16 | 17 | -------------------------------------------------------------------------------- /notepad++/error_downloading_the_plugin_list.md: -------------------------------------------------------------------------------- 1 | # Resolved: There was an error downloading the plugin list. 2 | 3 | I decided to try once again to use the plugin manager to get the [TextFX Characters plugin](install_textfx_plugin.md). 4 | 5 | Ran Plugin Manager... it needed to be updated. 6 | 7 | After the update: 8 | 9 | 1. It has ads: "Plugin list hosting generously provided by" (some business I'd like to DDOS) 10 | 11 | And message: 12 | 13 | > There was an error downloading the plugin list. Please check your internet connection, and your proxy settings in Internet Explorer, Edge or Chrome. 14 | 15 | So we went backwards. 16 | 17 | I changed the setting that says "Force HTTP instead of HTTPS for downloading Plugin List". Restarted Notepad++ and was then able to download the plugin list and install the TextFX Characters plugin. 18 | 19 | 20 | ## See also 21 | 22 | * [install textfx plugin](install_textfx_plugin.md) -------------------------------------------------------------------------------- /sql_server/how_much_space_does_my_db_use.md: -------------------------------------------------------------------------------- 1 | # How much space does my DB use? 2 | 3 | These two commands give you some nice summary info about your database: 4 | 5 | sp_helpdb MY_DATABASE_NAME 6 | go 7 | sp_spaceused 8 | 9 | 10 | (...including the names of the .mdf and .ldf files which you'll use for the [Backup restore script](backup_restore_script.md)) 11 | 12 | To see available space use: 13 | 14 | EXEC master..xp_fixeddrives 15 | 16 | 17 | ## Source 18 | 19 | * [Different ways to determine free space for SQL Server databases and database files](https://www.mssqltips.com/sqlservertip/1805/different-ways-to-determine-free-space-for-sql-server-databases-and-database-files/) 20 | 21 | ## See also 22 | 23 | * [Backup restore script](backup_restore_script.md) 24 | * [Need to delete backup files?](delete_backup_files.md) 25 | * [How much space is left on the drives that my sql server can access?](drive_sizes.md) 26 | -------------------------------------------------------------------------------- /csharp/version8.md: -------------------------------------------------------------------------------- 1 | # C# version 8 2 | 3 | https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8 4 | 5 | * [Readonly members](#readonly-members) 6 | * [Default interface members](#default-interface-members) 7 | * [Pattern matching enhancements:](#pattern-matching-enhancements:) 8 | * [Switch expressions](#switch-expressions) 9 | * [Property patterns](#property-patterns) 10 | * [Tuple patterns](#tuple-patterns) 11 | * [Positional patterns](#positional-patterns) 12 | * [Using declarations](#using-declarations) 13 | * [Static local functions](#static-local-functions) 14 | * [Disposable ref structs](#disposable-ref-structs) 15 | * [Nullable reference types](#nullable-reference-types) 16 | * [Asynchronous streams](#asynchronous-streams) 17 | * [Indices and ranges](#indices-and-ranges) 18 | 19 | 20 | ## Source 21 | 22 | * [what's new in C#8](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8) 23 | -------------------------------------------------------------------------------- /powershell/top_ten_files.md: -------------------------------------------------------------------------------- 1 | # Top 10 files by size, in all subfolders 2 | 3 | 4 | gci . -r | sort Length -d | select -f 10 | ft FullName, Length 5 | 6 | ^^ This relies on a trick: directories have no length. And it abbreviates things somewhat. 7 | 8 | A longer version.... 9 | 10 | gci -re -in * | 11 | ?{ -not $_.PSIsContainer } | 12 | sort Length -descending | 13 | select -first 10 14 | 15 | As a one liner 16 | 17 | gci -re -in * | ?{ -not $_.PSIsContainer } | sort Length -descending | select -first 10 18 | 19 | or if you want to exclude contents of `.hg` folder (as we do sometimes...) 20 | 21 | dir -rec -in * | ?{ -not $_.PSIsContainer -and $_.DirectoryName -notmatch ".hg" } | sort Length -descending | select -first 10 | % { $_.FullName + ", " + $_.Length } 22 | 23 | 24 | ## Source 25 | 26 | * -------------------------------------------------------------------------------- /windows/mstsc_black_screen.md: -------------------------------------------------------------------------------- 1 | # Use mstsc.exe to connect, receive Black screen 2 | 3 | After logging into a remote computer with remote desktop (rdp via mstsc.exe) the screen goes black. 4 | 5 | The trick is to press `Ctrl + Alt + End` 6 | 7 | ..which: 8 | 9 | > Brings up the Windows Security dialog box for the Remote Desktop Session Host (RD Session Host) (provides the same functionality as pressing CTRL+ALT+DEL on the local computer). 10 | 11 | This forces the entire screen to redraw, and thus invalidates the bitmap cache. 12 | 13 | The alternative is to change your remote desktop connection options (under "Experience" tab) : Uncheck "Persistent bitmap caching" 14 | 15 | ## Source 16 | 17 | * [why is my screen black after rdp connection?](http://superuser.com/questions/306412/why-is-my-screen-black-after-rdp-connection) 18 | * [Remote Desktop Services Shortcut Keys](https://msdn.microsoft.com/en-us/library/aa383500.aspx) 19 | -------------------------------------------------------------------------------- /.net_core_MVC/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # .net core MVC 3 | ### chapter contents 4 | 5 | * [bind post to action](bind_post_to_action.md) 6 | * [call bash](call_bash.md) 7 | * [CodeAnalysis CSharp Analyzers dll could not be found](CodeAnalysis_CSharp_Analyzers_dll_could_not_be_found.md) 8 | * [custom port](custom_port.md) 9 | * [documenting asp net core](documenting_asp_net_core.md) 10 | * [error in g cs](error_in_g_cs.md) 11 | * [form value count limit 1024 exceeded](form_value_count_limit_1024_exceeded.md) 12 | * [ip address](ip_address.md) 13 | * [no authentication handler](no_authentication_handler.md) 14 | * [remove accent](remove_accent.md) 15 | * [send email with mailkit](send_email_with_mailkit.md) 16 | * [server mappath](server_mappath.md) 17 | * [specified framework not found](specified_framework_not_found.md) 18 | * [UrlEncode](UrlEncode.md) 19 | * [UrlParameter-Optional](UrlParameter-Optional.md) 20 | * [view imports](view_imports.md) 21 | -------------------------------------------------------------------------------- /javascript/poor_mans_jquery.md: -------------------------------------------------------------------------------- 1 | # Poor Man's JQuery 2 | 3 | What it lacks in flexibility and versatility, it makes up for in brevity. 4 | 5 | function $(id) { 6 | return document.getElementById(id); 7 | } 8 | 9 | 10 | from [slide 44: coding while you commute](http://www.secretgeek.net/higgins/slides_alt_net.html#44) 11 | 12 | And here's the slightly less-poor poor man's jquery, updated for browsers in the modern age.... 13 | 14 | 15 | function $(selectors) { 16 | return document.querySelectorAll(selectors) 17 | } 18 | 19 | Note that this returns an array of elements. 20 | 21 | # External links 22 | 23 | * [You Might Not Need JQuery](http://youmightnotneedjquery.com/) 24 | * [vanilla-js](http://vanilla-js.com/) 25 | 26 | # Source 27 | 28 | * https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll 29 | * Suggestion from [George Kinsman](https://github.com/gkinsman) 30 | -------------------------------------------------------------------------------- /powershell/operation_is_blocked_by_software_restriction_policies.md: -------------------------------------------------------------------------------- 1 | # operation is blocked by software restriction policies 2 | 3 | On loading my [profile](create_profile.md) on a new machine, as a mortal account, I would suffer this problem: 4 | 5 | > File cannot be loaded because its operation is blocked by software restriction policies, such as those created by using Group Policy 6 | 7 | 8 | When running as admin I did not get the same issue. 9 | 10 | When running as a mortal account: 11 | 12 | Get-ExecutionPolicy -List 13 | 14 | ...showed me that the execution policy was `RemoteSigned` 15 | 16 | Right clicking on the file in explorer, and viewing properties, I expected to see an "Unblock" button -- but there was no such button. 17 | 18 | The trick was... it was a 0 byte file! It had been created but never populated. So I deleted the file, and all was good. 19 | 20 | 21 | ## See Also 22 | 23 | * [create profile](create_profile.md) 24 | -------------------------------------------------------------------------------- /windows.forms/key_down.md: -------------------------------------------------------------------------------- 1 | # Form Wide Hotkeys... 2 | 3 | For the form, make sure to set `this.KeyPreview = true;` 4 | 5 | Then you can define form-wide hotkeys like so... 6 | 7 | private void frmMain_KeyDown(object sender, KeyEventArgs e) 8 | { 9 | e.Handled = false; 10 | e.SuppressKeyPress = false; 11 | //F5, Ctrl+E, Alt+X .... all Execute! (just like query analyzer) 12 | if ((e.KeyCode == Keys.F5 && !e.Shift) 13 | || (e.KeyCode == Keys.E && e.Control) 14 | || (e.KeyCode == Keys.X && e.Alt)) 15 | { 16 | e.Handled = true; 17 | e.SuppressKeyPress = true; 18 | Execute(); 19 | return; 20 | } 21 | 22 | if (e.KeyCode == Keys.F5 && e.Shift) 23 | { 24 | e.Handled = true; 25 | e.SuppressKeyPress = true; 26 | Cancel(); 27 | return; 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /windows/01_summary.md: -------------------------------------------------------------------------------- 1 | 2 | # windows 3 | ### chapter contents 4 | 5 | * [bash on windows](bash_on_windows.md) 6 | * [disable cortana in windows 10](disable_cortana_in_windows_10.md) 7 | * [environment variables](environment_variables.md) 8 | * [mstsc black screen](mstsc_black_screen.md) 9 | * [mstsc without mouse](mstsc_without_mouse.md) 10 | * [notepad log file](notepad_log_file.md) 11 | * [program associated](program_associated.md) 12 | * [Remove Stored Credentials](Remove_Stored_Credentials.md) 13 | * [remove unreachable recyclebin crap](remove_unreachable_recyclebin_crap.md) 14 | * [screenshot with mouse cursor](screenshot_with_mouse_cursor.md) 15 | * [shutdown](shutdown.md) 16 | * [Turn off bing search results from Start Menu](Turn_off_bing_search_results_from_Start_Menu.md) 17 | * [when does password expire](when_does_password_expire.md) 18 | * [which version](which_version.md) 19 | * [windows store apps update](windows_store_apps_update.md) 20 | -------------------------------------------------------------------------------- /powershell/is_this_64_or_32_bit_powershell_today.md: -------------------------------------------------------------------------------- 1 | # Is this 64 or 32 bit PowerShell today? 2 | 3 | 4 | On PowerShell [version](version.md) 4.0 and up: 5 | 6 | [Environment]::Is64BitProcess 7 | 8 | 9 | More thorough again... 10 | 11 | # Is this a Wow64 powershell host 12 | function Test-Wow64() { 13 | return (Test-Win32) -and (test-path env:\PROCESSOR_ARCHITEW6432) 14 | } 15 | 16 | # Is this a 64 bit process 17 | function Test-Win64() { 18 | return [IntPtr]::size -eq 8 19 | } 20 | 21 | # Is this a 32 bit process 22 | function Test-Win32() { 23 | return [IntPtr]::size -eq 4 24 | } 25 | 26 | ## Source 27 | 28 | * http://stackoverflow.com/questions/8588960/determine-if-current-powershell-process-is-32-bit-or-64-bit 29 | 30 | ## See Also 31 | 32 | * [Which version of Windows is currently running?](../windows/which_version.md) 33 | * [which version of Powershell do I have?](version.md) -------------------------------------------------------------------------------- /tools/utils_repo.md: -------------------------------------------------------------------------------- 1 | # Have a utils repo 2 | 3 | I have a utils repo and you should too. 4 | 5 | It is a private repository that I clone onto any machine I use. 6 | 7 | It is on the [PATH](../powershell/PATH.md) of the machine, so its contents are always available. 8 | 9 | Why must it be a private repo? Because I don't have permission to redistribute all of the files. 10 | 11 | (Private repos are **free** at [bitbucket](https://bitbucket.org) but not free at github.) 12 | 13 | In the utils repo I keep: 14 | 15 | 1. All the "[little tools](list_of_tools.md)" I expect to be available and in the PATH on each machine 16 | 2. My powershell profile and powershell scripts 17 | 3. Handy LinqPad scripts 18 | 3. My 'Today I learned' notes -- it's where they are originally written, in a folder called TIL. 19 | (I also have a git repo which grabs that TIL folder, and publishes it as a gitbook at http://TIL.secretGeek.net) 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /powershell/count_distinct_rows.md: -------------------------------------------------------------------------------- 1 | # Count distinct rows (in powershell) 2 | 3 | By far my most commonly run query is this: 4 | 5 | Select Column, Count(*) 6 | from SomeTable 7 | Group by Column 8 | order by 2 desc 9 | 10 | When I have plain text and I want to perform that same check, I usually use a little tool I wrote called Grouply (or NimbleGroup) 11 | 12 | But to do it in plain powershell you use a command like this: 13 | 14 | cat .\22889_.txt | group | % { ($_.Name + ',' + $_.Count) } 15 | 16 | (Assuming 22889_.txt is a file containing the rows you wish to group.) 17 | 18 | 19 | Note: If all you want to do is **count** the number of lines, use `Measure-Object` (alias `measure`) instead. 20 | 21 | 22 | e.g. to count all the date entries (Date & Time Long Format) in a file called `journal.md` you can do this 23 | 24 | cat journal.md | ? { $_ -match '^[0-9]+:[0-9]+ (A|P)M [A-Z]+day, [0-9]+ [A-Z]+ [0-9]+' } | measure | % count 25 | --------------------------------------------------------------------------------