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
using System; | |
using System.Collections.Generic; | |
using System.Dynamic; | |
using System.Xml.Linq; | |
/// <summary> | |
/// Provides extension method for XElement to deserialize to a dynamic object | |
/// | |
/// The element's attributes will be stored as properties on the dynamic object. | |
/// The child elements will also be stored as properties on the dynamic object with the |
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
from itertools import permutations, product, zip_longest | |
from sys import argv | |
args = sum([[1, 11] if arg in "aA" else [int(arg)] for arg in argv[1:5]], []) | |
for xs in permutations(args, 4): | |
if sum(n == 1 or n == 11 for n in xs) > len(args) - 4: | |
continue | |
for ops in product("+-*/", repeat=3): | |
for exp in ["(...).(...)", "((...)..)..", "(..(...)).."]: |
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
template <typename Func, typename Arg> | |
struct curry_t | |
{ | |
template <typename ...Args> | |
auto operator()(Args&& ...args) | |
{ | |
return _func(_arg, std::forward<Args>(args)...); | |
} | |
Func _func; |
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
@function random-gray(){ | |
$col:random(5); | |
@return rgb($col * 51, $col * 51, $col * 51); | |
} | |
@function grid-dots(){ | |
$sh:(); | |
@for $j from 1 through 20 { | |
@for $i from 1 through 20 { | |
$sh: $sh, (($i*10px)-(10px)) (($j*10px)-(10px)) 0 random-gray(); |
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
import pytumblr | |
import yaml | |
import os | |
import urllib | |
# stolen from interactive_console.py, because I'm too lazy to oauth | |
# you'll need to register an app with Tumblr and use interactive_console.py for initial oauth | |
def create_client(): | |
yaml_path = os.path.expanduser('~') + '/.tumblr' |
NewerOlder