A Pen by Daniel Schmidt on CodePen.
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
# First, check out the commit you wish to go back to (get sha-1 from git log) | |
git reset --hard 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a | |
# Then do a forced update. | |
git push origin +9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a^:develop | |
# Push specific commit | |
git push origin 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a:develop -f |
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
# first, login with psql | |
psql -U USERNAME -d databasename | |
# set output for all queries | |
\o FILENAME.sql | |
# run this query | |
select 'drop table ' || tablename || ' cascade;' from pg_tables; | |
# logout from psql |
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 { expect } from 'chai'; | |
import 'mocha'; | |
import { | |
FlyWithWings, | |
FlyNoWay, | |
Quack, | |
MuteQuack, | |
Duck, | |
DuckWithAlternativeConstructor |
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 | |
// example code | |
function dynamicCall($someMsg) { | |
try { | |
$method = new ReflectionMethod('Foo', $someMsg); | |
$method->invoke(new Foo()); | |
}catch(Exception $error){ | |
exitTheHell($error); | |
} |
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
class SingletonCvar | |
def self.instance | |
@@instance ||= new | |
end | |
private_class_method :new | |
end | |
singleton = SingletonCvar.instance |
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 instance methods of classes as Rake tasks: | |
# | |
# In a folder tasks, create your classes. | |
# | |
# class FooTask | |
# extend RakeDecorator | |
# | |
# task :numbers, desc: 'A funny task that prints out the first 10 numbers' | |
# def print_numbers_task | |
# puts (1..10).to_a.join(',') |
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
# http://www.mono-project.com/Compiling_Mono_on_OSX | |
require 'formula' | |
class Mono < Formula | |
url 'http://download.mono-project.com/sources/mono/mono-3.2.3.tar.bz2' | |
sha1 'e356280ae45beaac6476824d551b094cd12e03b9' | |
homepage 'http://www.mono-project.com/' | |
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
<canvas id="404" width="600" height="600"></canvas> |
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
Show hidden characters
{ | |
"cmd": ["bash", "-c", "clang -lobjc -framework Cocoa -framework Carbon -o /tmp/sublime-objc-output $file"], | |
"file_regex": "^(.*?):([0-9]+):([0-9]+): (.*)", | |
"selector": "source.objc", | |
"variants": [ | |
{ | |
"name": "Run", | |
"cmd": ["bash", "-c", "clang -lobjc -framework Cocoa -framework Carbon -o /tmp/sublime-objc-output $file && /tmp/sublime-objc-output"] | |
} | |
] |
NewerOlder