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 | |
# Installs tarsnap client on Debian and Ubuntu | |
# | |
# You'll need to setup an account at | |
# http://www.tarsnap.com | |
# and load it with some funds | |
# | |
# Make sure you run this as root | |
# |
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
root@1ab2badf98de:/hibiscus-server/cfg# /hibiscus-server/jameicaserver.sh -p 234234234234234234 -f /srv/hibiscus2 | |
[Mon Jul 07 05:55:37 UTC 2014][INFO][de.willuhn.jameica.system.StartupParams.<init>] starting in SERVER mode | |
[Mon Jul 07 05:55:37 UTC 2014][INFO][de.willuhn.jameica.system.StartupParams.<init>] workdir: /srv/hibiscus2 | |
[Mon Jul 07 05:55:37 UTC 2014][INFO][de.willuhn.jameica.system.StartupParams.<init>] master password given via commandline | |
[Mon Jul 07 05:55:37 UTC 2014][INFO][de.willuhn.jameica.system.Application.init] starting jameica... | |
[Mon Jul 07 05:55:37 UTC 2014][INFO][de.willuhn.jameica.system.Platform.getWorkdir] using workdir: /srv/hibiscus2 | |
[Mon Jul 07 05:55:37 UTC 2014][INFO][de.willuhn.jameica.services.SecurityManagerService.init] applying jameica security manager | |
[Mon Jul 07 05:55:37 UTC 2014][INFO][de.willuhn.jameica.security.JameicaSecurityManager.<init>] protecting program dir /hibiscus-server/ | |
[Mon Jul 07 05:55:37 UTC 2014][INFO][de.willuhn.jameica.services.LockService.init] creati |
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
// https://github.com/Arnavion/libjass | |
// https://github.com/spiegeleixxl/html5-ass-subtitles/blob/master/assparser.js | |
Subtitles = {}; | |
Subtitles.ASS = function(content) { | |
var linesOfDialog = []; |
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 | |
# https://github.com/Ceryn/img | |
# Call with '-s' to target only a selection of the screen. | |
clientid='3e7a4deb7ac67da' | |
img=$1 | |
res=$(curl -sH "Authorization: Client-ID $clientid" -F "image=@$img" "https://api.imgur.com/3/upload") | |
echo $res | |
echo $res | grep -qo '"status":200' && link=$(echo $res | sed -e 's/.*"link":"\([^"]*\).*/\1/' -e 's/\\//g') |
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
# Adapted from http://foobar.lu/wp/2013/07/05/automagic-__repr__-for-sqlalchemy-entities-with-primary-key-columns-with-declarative-base/ | |
class RepresentableBase(object): | |
""" | |
This class can be used by ``declarative_base``, to add an automatic | |
``__repr__`` method to *all* subclasses of ``Base``. This ``__repr__`` will | |
represent values as:: | |
ClassName(pkey_1=value_1, pkey_2=value_2, ..., pkey_n=value_n) |
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
// Modify contrast using a ColorMatrix (on Android) | |
ColorMatrixColorFilter setContrast(float contrast) { | |
float scale = contrast + 1.f; | |
float translate = (-.5f * scale + .5f) * 255.f; | |
float[] array = new float[] { | |
scale, 0, 0, 0, translate, | |
0, scale, 0, 0, translate, | |
0, 0, scale, 0, translate, | |
0, 0, 0, 1, 0}; | |
ColorMatrix matrix = new ColorMatrix(array); |
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 ColorDict(object): | |
"""Provides a color for each key, trying to create as distinct a set | |
of colors as possible. | |
""" | |
# Minimum difference in hue between unique colors, before we begin | |
# to recycle old colors rather than generating new ones. | |
THRESHOLD = 0.05 | |
def __init__(self): |
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
"scripts": { | |
"build-js": "react-native bundle --url 'lib/index.ios.bundle?platform=ios&dev=' --minify && mv ios/main.jsbundle ios/project && git update-index --assume-unchanged ios/project/main.jsbundle", | |
}, |
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
var GraphQL = Relay.QL.__GraphQL; | |
return new GraphQL.QueryFragment( | |
'Builder', 'AddMenuItemPayload', | |
[new GraphQL.Field('node', null, null, null, null, null, {parentType: 'AddMenuItemPayload'}), | |
new GraphQL.Field('client', [ | |
new GraphQL.Field('menuitems', [ | |
new GraphQL.Field('count', null, null, null, null, null, {parentType: 'MenuItemConnection'})], | |
null, | |
[new GraphQL.Callv('first', new GraphQL.CallVariable('format'))], | |
null, null, {parentType: 'Client', connection: true, nonFindable: true}), |
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
The idea is two provide optional variations for your stylesheet, for | |
presentation purposes, and have a switcher built into the page to | |
enable/disable them. | |
Usage - include the Javascript code in your page: | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script src="cssoptions.js"></script> | |
Note that jQuery >= 1.7 is required. |
OlderNewer