⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python -tt | |
"""Xcode4 installs and expects to find a git installation at /usr/bin. | |
This is a pain if you want to control your own installation of git that | |
might be installed elsewhere. This script replaces the git files in | |
/usr/bin with symlinks to the preferred installation. | |
Update the 'src_directory' to the location of your preferred git installation. | |
""" | |
import sys |
I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.
I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.
This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Use Vim settings, rather then Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
" ================ General Config ==================== | |
set number "Line numbers are good | |
set backspace=indent,eol,start "Allow backspace in insert mode | |
set history=1000 "Store lots of :cmdline history | |
set showcmd "Show incomplete cmds down the bottom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Using a single instance of these arrays prevents an allocation of a new array on every call to something like | |
/// string.Split(';') which is really calling string string.Split(params char[] separator), causing an allocation | |
/// of an additional array behind the scenes. | |
/// </summary> | |
/// <remarks> | |
/// For most applications this is a micro-optimization that doesn't matter. However, for very high traffic code paths | |
/// this can generate a significant amount of items that the gen 0 garbage collector needs to collect, causing micro-stalls | |
/// in the app domain when it runs, or runs more often. | |
/// </remarks> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AutofacConfig | |
{ | |
public static void Configure() | |
{ | |
var builder = new ContainerBuilder(); | |
builder.RegisterType<ApplicationDbContext>().AsSelf().InstancePerLifetimeScope(); | |
builder.RegisterType<ApplicationUserStore>().As<IUserStore<PortalUser>>().InstancePerLifetimeScope(); | |
builder.RegisterType<ApplicationUserManager>().AsSelf().InstancePerLifetimeScope(); | |
builder.RegisterType<ApplicationSignInManager>().AsSelf().InstancePerLifetimeScope(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################## | |
# Privacy Settings | |
################## | |
# Privacy: Let apps use my advertising ID: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0 | |
# To Restore: | |
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1 | |
# Privacy: SmartScreen Filter for Store Apps: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project DefaultTargets="PrepareStaticContent" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<!-- Passed in Parameters --> | |
<configuration></configuration> | |
<workingDir></workingDir> | |
<buildNumber></buildNumber> | |
<buildViews>false</buildViews> | |
<minifyJs>true</minifyJs> | |
<TargetsDirectory></TargetsDirectory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here are some example usages for unimportant jobs we have where crap happens occasionally: | |
/// <summary> | |
/// intended for database commands that might deadlock, but are just "nice to haves"; we don't care if they deadlock every now and then | |
/// and we DON'T want them to block execution of the rest of /daily or /hourly! this returns -1 if deadlocked, otherwise, returns | |
/// the # of rows that the SQL command affected | |
/// </summary> | |
private int ExecuteIgnoreDeadlocks(string sql, object param = null, bool logDeadlock = false) | |
{ | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Numerics; | |
#if NETCOREAPP2_1_OR_GREATER | |
using System.Buffers.Binary; | |
#endif | |
#nullable enable |
OlderNewer