Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| from util import * | |
| from lam import * | |
| from ty import * | |
| def extract(t, *kind): | |
| if type(t) is Lam: | |
| res = extract(t.args[1], *kind) | |
| if Lam in kind: res.add(t) | |
| if Var in kind: res.add(t.args[0]) |
This file contains hidden or 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
| #include<stdio.h> | |
| #include<stdlib.h> | |
| #include<assert.h> | |
| #include<string.h> | |
| #include<ctype.h> | |
| void handle_args(int argc, char*argv[], char *neg, FILE **fp); | |
| int main(int argc, char*argv[]) | |
| { |
This file contains hidden or 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 jsdom = require("jsdom").jsdom; | |
| var Readability = require("./index").Readability; | |
| var express = require("express"); | |
| var app = express(); | |
| function removeCommentNodesRecursively(node) { | |
| for (var i = node.childNodes.length - 1; i >= 0; i--) { | |
| var child = node.childNodes[i]; | |
| if (child.nodeType === child.COMMENT_NODE) { |
This file contains hidden or 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 jsdom = require("jsdom").jsdom; | |
| var Readability = require("./index").Readability; | |
| function removeCommentNodesRecursively(node) { | |
| for (var i = node.childNodes.length - 1; i >= 0; i--) { | |
| var child = node.childNodes[i]; | |
| if (child.nodeType === child.COMMENT_NODE) { | |
| node.removeChild(child); | |
| } else if (child.nodeType === child.ELEMENT_NODE) { | |
| removeCommentNodesRecursively(child); |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import requests | |
| d = requests.get('https://www.reddit.com/r/EarthPorn/top/.json', headers={'User-agent':'IOTD bot'}).json() | |
| for c in d['data']['children']: | |
| src = c['data']['preview']['images'][0]['source'] | |
| if src['width'] >= 4000: | |
| print 'Location: ' + src['url'] + '\n' | |
| break |
This file contains hidden or 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 | |
| # http://superuser.com/a/1068709/55113 | |
| for file in ~/.local/share/applications/*.desktop; do | |
| CLASS="`grep '^StartupWMClass=' "$file" | cut -d= -f2`" | |
| if [ -n "$CLASS" ] && ! grep -q xdotool "$file"; then | |
| EXEC="`grep '^Exec=' "$file"`" | |
| EXEC="$EXEC \\&\\& xdotool search --sync --classname $CLASS set_window --class $CLASS" | |
| sed -i~ "s!^Exec=.*!$EXEC!" "$file" | |
| fi | |
| done |
This file contains hidden or 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
| /* passable motion blur effect using frame blending | |
| * basically move your 'draw()' into 'sample()', time runs from 0 to 1 | |
| * by dave | |
| * http://beesandbombs.tumblr.com | |
| */ | |
| int samplesPerFrame = 32; // more is better but slower. 32 is enough probably | |
| int numFrames = 48; | |
| float shutterAngle = 2.0; // this should be between 0 and 1 realistically. exaggerated for effect here | |
| int[][] result; |
This file contains hidden or 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
| [ | |
| "abstract.coffee", | |
| "animal.coffee", | |
| "applause.coffee", | |
| "aww.coffee", | |
| "bang-bang.coffee", | |
| "base58.coffee", | |
| "base64.coffee", | |
| "botsnack.coffee", | |
| "coin.coffee", |
This file contains hidden or 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 | |
| # https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution%29#PRoot_Installation | |
| OPT=$HOME/opt | |
| ARCH=x86_64 | |
| VER_NIX=nix-1.10-$ARCH-linux | |
| URL_NIX=http://hydra.nixos.org/build/25489771/download/1/$VER_NIX.tar.bz2 | |
| mkdir $OPT | |
| mkdir $OPT/bin && cd $OPT/bin && wget http://static.proot.me/proot-$ARCH && chmod u+x proot-$ARCH |