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
#!/bin/bash | |
#paranoid (in case the langguage-pack-en is not installed, which is rare) | |
sudo apt-get -q install language-pack-en.* | |
#write to /etc/default/locale | |
#changes only take effect after logout | |
sudo update-locale --reset LANG=en_US.UTF-8 LC_MESSAGES=POSIX LC_ALL=en_US.UTF-8 | |
#generate locale files if required |
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
Option Explicit | |
Function FileDelete(Filename As String) As String | |
Dim fso As New FileSystemObject | |
On Error Resume Next | |
Err.Clear | |
Call fso.DeleteFile(Filename) | |
On Error GoTo 0 | |
If Err.Number <> 0 Then |
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
[alias] | |
st = status | |
co = checkout | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
br = branch -v | |
dt = difftool --dir-diff | |
gshow = !f() { git difftool --dir-diff $1^..$1; }; f | |
llg = !f() { git lg $(git branch --column | tr -d '*' | tr -s ' '); }; f | |
[user] |
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
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION | |
SET TGT=%1 | |
SET TGT=%TGT:"=% | |
IF "%TGT%"=="" SET TGT=* | |
takeown /f "%TGT%" /R /D Y > nul | |
icacls "%TGT%" /reset /t /q | |
icacls "%TGT%" /grant %USERNAME%:F /t /q | |
attrib -r -h -s "%TGT%" /s /l /d |
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.Text; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.IO; | |
namespace TheBestAppEver | |
{ | |
/// <summary> | |
/// The type of <see cref="ListDiffAction{S,D}"/>. |
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
struct FileNode | |
{ | |
public string Name; | |
public bool IsDirectory; | |
public Exception Error; | |
public bool HasError { get { return this.Error!=null; } } | |
} | |
void Main() |
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
#!/bin/bash | |
# May not work if filename have spaces | |
# Inspired by this answer on StackOverflow | |
# http://stackoverflow.com/questions/5566310/how-to-recursively-find-and-list-the-latest-modified-files-in-a-directory-with-s | |
find . -type f -printf '%T@ %P\n' | sort -nr | cut -d ' ' -f2- | head | |
## Windows Version ## | |
# gfind . -type f -name "clean*.php" -printf "%T@ \"%P\"\n" | gsort -nr | cut -d ' ' -f2- | |
# Assumes gfind = Gnu find and gsort Gnu sort |
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
/* | |
jquery.draghover.js | |
Emulates draghover event by tracking | |
dragenter / dragleave events of element + children. | |
https://gist.github.com/gists/3794126 | |
http://stackoverflow.com/a/10310815/4196 |
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
# Personal files | |
*.user | |
#dev.config | |
#connections.config | |
# Build results | |
[Dd]ebug/ | |
[Rr]elease/ | |
[Bb]in/ | |
[Oo]bj/ |
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
<?php | |
/* Create a socket, bind to port 0, kernel assigns a free port. Read port number, close socket | |
* This works *mostly* because the kernel tries hard to avoid re-using ports. So the port returned | |
* by this function should remain available for a bit after this process has terminated. | |
*/ | |
echo "Available local port: " . getFreeLocalTcpPort(); | |
function getFreeLocalTcpPort() { | |
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); |