I hereby claim:
- I am peppelorum on github.
- I am peppelorum (https://keybase.io/peppelorum) on keybase.
- I have a public key whose fingerprint is F9FB 8E92 FC0A 7FA0 3A9B D36C EC26 DF30 3C6E 578F
To claim this, I am signing this object:
-- How to activate a certain display on MacOS with an Apple Script. | |
tell application "System Preferences" | |
if not running then run | |
activate | |
reveal anchor "displaysArrangementTab" of pane id "com.apple.preference.displays" | |
tell application "System Events" | |
tell application process "System Preferences" | |
tell first window |
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does | |
import hudson.model.*; | |
import hudson.util.*; | |
import jenkins.model.*; | |
import hudson.FilePath.FileCallable; | |
import hudson.slaves.OfflineCause; | |
import hudson.node_monitors.*; | |
for (node in Jenkins.instance.nodes) { |
I hereby claim:
To claim this, I am signing this object:
oscarApp.factory('sessionInjector', ['Auth', function(Auth) { | |
var sessionInjector = { | |
request: function(config) { | |
if (Auth.isLoggedIn()) { | |
config.headers['x-session-token'] = Auth.data.apiKey; | |
} | |
return config; | |
} | |
}; | |
return sessionInjector; |
from django.db.models import Count | |
dupes = Episode.objects.values('url').annotate(count=Count('id')).order_by().filter(count__gt=1) | |
Episode.objects.filter(url__in=[item['url'] for item in dupes]).delete() | |
from django.core.cache import cache | |
cache.clear() |
var arr = []; | |
var l = 10000000; | |
var tmp; | |
for (var i = 0; i < l; i++) { | |
arr.push(Math.round(Math.random() * l)); | |
} | |
console.time('Unsorted timer'); |
import random | |
import time | |
a = [int(random.random() * 1000) for _ in xrange(10000000)] | |
program_starts = time.time() | |
for item in a: | |
tmp = False | |
now = time.time() |
function(input) { | |
// Check valid length & form | |
if (!input) { return false; } | |
if (input.indexOf('-') === -1) { | |
if (input.length === 10) { | |
input = input.slice(0, 6) + "-" + input.slice(6); | |
} else { | |
input = input.slice(0, 8) + "-" + input.slice(8); | |
} |
>>> 'http://www.svtplay.se/video/52776/mysteriet-med-den-forsvunna-jellybean-listan?tab=episodes&sida=100'.rpartition('/') | |
('http://www.svtplay.se/video/52776', '/', 'mysteriet-med-den-forsvunna-jellybean-listan?tab=episodes&sida=100') | |
>>> 'http://www.svtplay.se/video/52776/mysteriet-med-den-forsvunna-jellybean-listan?tab=episodes&sida=100'.rpartition('/')[0] | |
'http://www.svtplay.se/video/52776' |
import requests | |
from rethinkdb.errors import RqlRuntimeError | |
import rethinkdb as r | |
r.connect('localhost', 28015).repl() | |
try: | |
r.db('wlps').table_create('episode').run() | |
except RqlRuntimeError: | |
pass |