Skip to content

Instantly share code, notes, and snippets.

@sdornan
sdornan / Link.tsx
Created April 14, 2022 15:21
Custom Next.js MUI Link component
<style>
.embeddedServiceHelpButton .helpButton .uiButton {
background-color: #0068B5;
font-family: "Founders Grotesk", "Roboto", sans-serif;
font-size: 0.600em;
min-width: 9em;
max-width: 11em;
}
.embeddedServiceHelpButton .helpButton .uiButton:focus {
outline: 1px solid #0068B5;
@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;
@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 *
# 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) ->
# 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')
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
while not redis.setnx(self.THROTTLE_KEY, datetime.datetime.now() + datetime.timedelta(seconds=3)):
time.sleep(1)
redis.expire(self.THROTTLE_KEY, 3)
@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',
@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: