Skip to content

Instantly share code, notes, and snippets.

@sdornan
sdornan / gist:a42086904350e64d3d71
Created April 1, 2015 03:50
Load test settings automatically
# if manage.py test was called, use test settings
if 'test' in sys.argv:
from scc.host_settings.test import *
==> Downloading http://kernel.org/pub/software/scm/git/git-1.7.6.tar.bz2
File already downloaded in /Users/sdornan/Library/Caches/Homebrew
/usr/bin/tar xf /Users/sdornan/Library/Caches/Homebrew/git-1.7.6.tar.bz2
==> make prefix=/usr/local/Cellar/git/1.7.6 install
make prefix=/usr/local/Cellar/git/1.7.6 install
GIT_VERSION = 1.7.6
* new build flags or prefix
./generate-cmdlist.sh > common-cmds.h+ && mv common-cmds.h+ common-cmds.h
gcc -o hex.o -c -O3 -march=native -w -pipe -I. -DUSE_ST_TIMESPEC -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM hex.c
gcc -o ident.o -c -O3 -march=native -w -pipe -I. -DUSE_ST_TIMESPEC -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM ident.c
Your OS X is ripe for brewing.
Any troubles you may be experiencing are likely purely psychosomatic.
@sdornan
sdornan / replace_wow_icons.py
Created October 11, 2011 00:05
Replace WoW Achievement Icons
from giantbomb.game_achievements.models import Achievement
from giantbomb.game_achievements.services import base, wow
wf = wow.WarcraftFetcher()
agg = base.Aggregator()
wow_achs = Achievement.objects.filter(service_game__service=4)
num_achs = len(wow_achs)
for index, ach in enumerate(wow_achs):
print '(%s/%s): Replacing icon of %s' % (index+1, num_achs, ach)
try:
@sdornan
sdornan / dep_wow_achs.py
Created October 11, 2011 17:21
Deprecated WoW Achievements
[u'2901',
u'2896',
u'760',
u'2900',
u'4785',
u'4784',
u'1739',
u'1830',
u'1831',
u'1731',
while not redis.setnx(self.THROTTLE_KEY, datetime.datetime.now() + datetime.timedelta(seconds=3)):
time.sleep(1)
redis.expire(self.THROTTLE_KEY, 3)
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/usr/local/opt/php54/bin/php-config
# use require to load any .js file available to the asset pipeline
#= require jquery
#= require controllers
#= require angular-mocks
describe "App controllers", ->
$httpBackend
beforeEach inject ($injector) ->
$httpBackend = $injector.get('$httpBackend')
# use require to load any .js file available to the asset pipeline
#= require jquery
#= require sony/sony
#= require angular-mocks
describe 'HomeCtrl', ->
$httpBackend
beforeEach inject ($injector) ->
@sdornan
sdornan / app.component.ts
Last active September 2, 2016 00:13
angular2-rc5 Circular Dependency Code
import { Component, ViewEncapsulation, ViewContainerRef } from '@angular/core';
@Component({
selector: 'app',
template: require('./app.component.pug'),
styles: [require('./app.component.scss')],
encapsulation: ViewEncapsulation.None
})
export class AppComponent {
loaded: boolean = false;