Skip to content

Instantly share code, notes, and snippets.

@stevommmm
stevommmm / gist:8857493
Created February 7, 2014 04:48
creative resolve durations
[1281, 1276, 1772, 1528, 2174, 5676, 5759, 9910, 40545, 35680, 89565, 99986, 119149, 12379, 3887, 9921, 30199, 38191, 28001, 37986, 7241, 5834, 1491, 97940, 102724, 6135, 1443, 608, 5814, 4417, 1111, 7239, 31675, 26012, 1772, 5565, 5257, 11019, 711, 1229, 5234, 563, 138417, 11306, 62774, 12509, 55030, 19385, 23992, 1289, 7151, 71954, 1978, 7197, 9858, 9462, 8535, 4389, 274, 611, 1526, 11666, 3954, 26049, 55283, 2318, 8312, 144246, 37897, 2705, 14232, 548, 2327, 2561, 480, 38242, 2414, 68837, 76649, 65425, 375, 554, 1557, 18938, 7135, 1336, 5156, 451, 558, 169094, 718, 814, 5514, 5000, 1728, 2553, 15185, 628, 8269, 25990, 37099, 6688, 10292, 21680, 3328, 2666, 1582, 1399, 64631, 10770, 1208, 1052, 6363, 1465, 22170, 36736, 83726, 83041, 89638, 20629, 20793, 32786, 31910, 78582, 6454, 154339, 60411, 91382, 5111, 2665, 764, 1301, 5708, 8142, 600, 3557, 8705, 3503, 15823, 17153, 18590, 18890, 24681, 1189, 547, 302, 6792, 1697, 7245, 39529, 40033, 43813, 1810, 571, 15326, 2472, 5279, 10317, 12855, 25590, 32359, 32
@stevommmm
stevommmm / reflectOutBackend.php
Last active August 29, 2015 13:57
Remove ability to set passwords via authentication backends in OwnCloud
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
$myClassReflection = new ReflectionClass(get_class(OC::$server->getUserManager()));
$secret = $myClassReflection->getProperty('backends');
$secret->setAccessible(true);
foreach($secret->getValue(OC::$server->getUserManager()) as $bkend) {
// var_dump($bkend);
$lclrefclass = new ReflectionClass($bkend);
$s = $lclrefclass->getProperty('possibleActions');
$s->setAccessible(true);
@stevommmm
stevommmm / keybase.md
Created May 19, 2014 23:43
keybase.md

Keybase proof

I hereby claim:

  • I am stevommmm on github.
  • I am c45y (https://keybase.io/c45y) on keybase.
  • I have a public key whose fingerprint is 1EA9 9344 5B7C 9817 0AC0 4135 5243 019A 99B7 B1A3

To claim this, I am signing this object:

#header {
animation-name: hue_span;
animation-duration: 20s;
animation-timing-function: ease-out;
animation-iteration-count: infinite;
animation-direction: normal;
animation-play-state: running;
}
@keyframes hue_span {
@stevommmm
stevommmm / core.css
Created July 17, 2014 10:23
netchat.io alternate stylesheet
@font-face {
font-family: "Lato";
font-style: normal;
font-weight: 400;
src: local("Lato Regular"), local("Lato-Regular"), url("http://themes.googleusercontent.com/static/fonts/lato/v7/9k-RPmcnxYEPm8CNFsH2gg.woff") format("woff");
}
@font-face {
font-family: "Lato";
font-style: normal;
@stevommmm
stevommmm / style.css
Created July 23, 2014 00:17
williammck.net style
html {
height: 100%;
-webkit-font-smoothing: antialiased;
}
body {
font-family: 'Open Sans', sans-serif;
color: #888;
font-weight: 400;
font-size: 12px;
@stevommmm
stevommmm / .bashrc
Created September 1, 2014 23:38
.bashrc
# Exit if we aren't interactive
[ -z "$PS1" ] && return
shopt -s checkwinsize
lowpriv="\[\033[1;48;5;32m\]"
rootpriv="\[\033[1;48;5;1m\]"
dirpath="\[\033[38;5;220;48;5;238m\]"
reset="\[\033[00m\]"
@stevommmm
stevommmm / funcman.py
Last active August 29, 2015 14:06
funcs to forms in python
import logging
import types
funcs = []
def decorator(func, *args, **kwargs):
if type(func) != types.FunctionType:
return decorator
funcs.append(func)
@stevommmm
stevommmm / multi_sock.py
Last active August 29, 2015 14:07
Mutliprocessing thread socket pool
#!/usr/bin/env python
import select
import socket
from multiprocessing import current_process, active_children
from multiprocessing.pool import ThreadPool
class SockPool(object):
"""Threaded socket pool making use of multiprocessing.pool.ThreadPool and select.select"""
def __init__(self, host, port, poolsize=10, backlog=10, readsize=1024):
SELECT type, SUM(created) AS created, SUM(destroyed) AS destroyed FROM (
(SELECT type, count(type) AS created, 0 AS destroyed FROM `lb-world` INNER JOIN `lb-players` USING (playerid) WHERE playername = 'DOKDOR' AND type > 0 AND type != replaced $dateClause GROUP BY type)
UNION
(SELECT replaced AS type, 0 AS created, count(replaced) AS destroyed FROM `lb-world` INNER JOIN `lb-players` USING (playerid) WHERE playername = 'DOKDOR' AND replaced > 0 AND type != replaced $dateClause GROUP BY replaced)
) AS t GROUP BY type ORDER BY SUM(created) + SUM(destroyed) DESC