Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("sum", type=int)
parser.add_argument("-s", "--start", type=int, default=1, help="start searching from a specific digit", metavar="DIGIT")
parser.add_argument("-t", "--stop", type=int, default=9, help="stop searching at a specific digit", metavar="DIGIT")
parser.add_argument("-n", "--min-addends", type=int, default=1, help="minimum number of addends", metavar="MIN")
parser.add_argument("-m", "--max-addends", type=int, default=9, help="maximum number of addends", metavar="MAX")
#!/usr/bin/python
'''
This script downloads your likes from your Tumblr blog.
It needs *BOTH* a valid OAuth key + secret *AND* a user token (obtained through OAuth).
Obtain the former here: https://www.tumblr.com/oauth/apps
Obtain the latter through API Explorer: https://api.tumblr.com/console/calls/user/info
(or through the nonsense of an OAuth dance if you'd like, this is Tumblr anyway,
I won't kink-shame you. But seriously.)
// From Underscore.js 1.8.3 (http://underscorejs.org
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
function _extend(obj)
{
var length = arguments.length;
if (length < 2 || obj == null)
{
return obj;
import bpy
bpy.context.user_preferences.system.compute_device_type = 'CUDA'
bpy.context.user_preferences.system.compute_device = 'CUDA_0'
bpy.context.scene.cycles.device = 'GPU'
print(bpy.context.scene.cycles.device)
@balbinus
balbinus / snmp__apc_ups2_
Created September 25, 2014 13:24
Edited version of "ups2" munin plugin to handle some custom MIBS for MGE UPS (EATON 1500i in my case). Source of MIBS: http://soft.apc.com/emb/66244/mgeupsmib17_ac.mib
#!/usr/bin/perl -w
#
# Jean-Samuel Reynaud <[email protected]>
# base on snmp__if_ from Jimmy Olsen, Dagfinn Ilmari Mannsaaker
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 dated June,
# 1991.
#