Skip to content

Instantly share code, notes, and snippets.

@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@pamelafox
pamelafox / browser.js
Created February 13, 2013 17:35
Browser banner warning
(function(wndw) {
var Browsers, OS, Platform, Versions, browser_name, browser_version, os, platform;
Versions = {
Firefox: /firefox\/([\d\w\.\-]+)/i,
IE: /msie\s([\d\.]+[\d])/i,
Chrome: /chrome\/([\d\w\.\-]+)/i,
Safari: /version\/([\d\w\.\-]+)/i,
Ps3: /([\d\w\.\-]+)\)\s*$/i,
Psp: /([\d\w\.\-]+)\)?\s*$/i
};
@wumpz
wumpz / gist:5846559
Created June 23, 2013 21:12
list authors of a git repository including commit count and email
git shortlog -e -s -n
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
@BillWagner
BillWagner / EvalOrder
Created September 5, 2013 20:47
This shows that the evaluation order of parameters is dictated by their order all that call site, not the order in the function definition.
class Program
{
static void Main(string[] args)
{
int i = 5;
EvalOrder(++i, i++); // 6, 6
Console.WriteLine(i); // 7
EvalOrder(second: ++i, first: ++i); // 9, 8
Console.WriteLine(i); // 9
git log --name-only | grep php --exclude=trunk | sort | uniq -c | sort -nr | head -n 25 > churn.txt
This one looks like an odd ball but what it does is:
- looks at the git log file, retrieving just the filenames;
- greps to extract those filenames, excluding anything from the old SVN /trunk structure;
- sorts the list of files to get the duplicates together;
- eliminates the duplicates but keeps a count of them;
- resorts the file names by that count; and
@sdawncasey
sdawncasey / gist:332967a7de3231c76446
Created July 6, 2014 17:06
Working on a new project
<?php
class Casey {
public $hair = 'brown';
public $eyes = 'brown';
public $loves = array('monkeys', 'SciFi', 'texas', 'music');
}
$human = new Casey();
$human->birthday('2015-02-02');
$human->fingers = 10;
@anaisbetts
anaisbetts / .gitattributes
Created December 3, 2014 16:26
USE THIS GITATTRIBUTES FOR EVERY NEW PROJECT FOREVER AND EVER
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@coridrew
coridrew / happy_git_on_osx.md
Last active January 15, 2016 03:04 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"