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
/* | |
Copyright (c) 2010 Adam Duke | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
/* Forces exclusive access to a database allowing a restore and subsequently restores the database from a backup file. This will interrupt any existing connections and rollback any in progress transactions. Use at your own risk. */ | |
ALTER DATABASE [database_name] SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
RESTORE DATABASE [database_name] | |
FROM DISK = N'C:\path\to\backup\backupfile.bak' | |
WITH FILE = 1, KEEP_REPLICATION, NOUNLOAD, REPLACE, STATS = 10 | |
GO |
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
#gsed is the GNU version of sed | |
#OSX ships with the BSD version which is apparently not the same | |
gsed -i 's/\([[:space:]]*\)\([[:print:]]\{1,\}\){/\1\2\n\1{/' ./Classes/*.m |
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
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class Dependencies { | |
Map <String, Collection <String>> dependencyMap = new HashMap <String, Collection <String>>(); |
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
set func_call_user NilOrNotNSNull | |
indent_align_string=false | |
indent_braces=false | |
indent_braces_no_func=false | |
indent_brace_parent=false | |
indent_namespace=false | |
indent_extern=false | |
indent_class=false | |
indent_class_colon=false |
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 | |
$var_utmac='UA-XXXXX'; //enter the new urchin code | |
$var_utmhn='ihazdomain.com'; //enter your domain | |
$var_utmcs='UTF-8'; // character set? | |
$var_utmsr='800x600'; //screen resolution | |
$var_utmsc='24-bit'; // screen colors | |
$var_utmul='en-us'; // language | |
$var_utmn=rand(1000000000,9999999999);//random request number | |
$var_cookie=rand(10000000,99999999);//random cookie number | |
$var_random=rand(1000000000,2147483647); //number under 2147483647 |
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
via: http://groups.google.com/group/phillycocoa/browse_thread/thread/2d05f3eac5a7d260?hl=en | |
revert file: | |
git checkout HEAD path/to/file | |
OR | |
git checkout filename | |
pluck one file from another branch | |
git checkout Branch path/to/file |
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 ruby | |
# Seems a bit silly to have a script to run redcloth considering you can just run | |
# $ redcloth inputfile.textile > outputfile.html | |
# but whatever | |
class Textilize | |
require 'rubygems' | |
require 'redcloth' |
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/sh | |
#uncrustify -l OC -c ~/.uncrustify --no-backup $(find -x -E $SRCROOT -not -regex '.*/\.?External/*.*' -name "*.[mh]") | |
if [ $# -ne 1 ]; then | |
echo "Please pass the name of the directory to format" | |
exit 1; | |
fi | |
if [ ! -d $1 ]; then | |
echo "$1 is not a directory" |
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
HttpURLConnection connection = (HttpURLConnection) requestTokenURL.openConnection(selectProxy(requestTokenURL)); |
OlderNewer