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
sleep 0.2; | |
scrot -q 90 -s /home/saucecode/tmp/shot.jpg | |
SHOT=/home/saucecode/tmp/shot.jpg | |
OUTPUT=$(curl --silent -sf -F "files[]=@$SHOT" "http://pomf.se/upload.php" | grep -Eo '"url":"[A-Za-z0-9]+.*",' | sed 's/"url":"//;s/",//') | |
echo http://a.pomf.se/$OUTPUT | xclip -selection "clipboard" | |
mplayer /home/saucecode/tmp/confirm.wav |
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 socket, random, string, hashlib | |
''' | |
challenge request packet format | |
\x08[HASH] [START] [SEED] | |
sends a hash algorithm (SHA1, MD5, etc), what the hash must start with, and what the prehashed string must start with | |
challenge response packet format | |
\x09[FULL PRE-HASH] | |
The [FULL PRE-HASH] must start with [SEED] and when hashed with [HASH] algorithm, the result starts with [START] |
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
# fourthgrademaths.py | |
import random, time | |
def start(question_count): | |
rightAnswers = 0 | |
wrongAnswers = 0 | |
startTime = time.time() | |
for i in range(question_count): | |
qtype = random.randint(0,3) | |
if qtype == 0: # addition |
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
private boolean canSee(float x, float y) { | |
float delta = 0.1f; | |
float targetDistance = (float) Math.hypot(x-this.x, y-this.y); | |
float angle = (float) (game.calcAngle(this.x, this.y, x, y) - Math.PI/2f); | |
float dx = (float) Math.sin(angle) * delta; | |
float dy = (float) -Math.cos(angle) * delta; | |
float mx = this.x, my = this.y; | |
for(float distance=0; distance < targetDistance; distance+=delta){ |
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
# This has been moved to a repo -- https://github.com/saucecode/postfix-calculator | |
# all future updates found there | |
#!/usr/bin/env python | |
# postfix.py - a postfix calculator for python 2 & 3 | |
# version 5 2016-09-20 | |
import string, math | |
import inspect |
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
var vapor = require('vapor'); | |
var request = require('request'); | |
var username = "[REDACTED]"; | |
var password = "[REDACTED]"; | |
var config = { | |
username: username, | |
password: password, | |
displayName: "[REDACTED]", |
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 urllib2, json, os, time | |
albumurl = raw_input('imgur album url: ') | |
foldername = albumurl.split('/')[-1].split('#')[0] | |
if not os.path.exists(foldername+'/'): os.mkdir(foldername+'/') | |
print 'downloading html...' | |
albumhtml = urllib2.urlopen(albumurl).read() | |
jdata = '{"count":'+albumhtml.split("{\"count\":")[1].split('\n')[0][:-1] | |
data = json.loads(jdata) | |
print 'going to download',len(data['items']),'images into folder:',foldername |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#define PI 3.14159265 | |
// https://www.reddit.com/r/dailyprogrammer/comments/3zfajl/20160104_challenge_248_easy_draw_me_like_one_of/ | |
struct rgb_t { | |
unsigned char r; |
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
0 0 7 0 0 0 2 2 2 0 0 0 0 0 0 | |
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | |
0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 | |
0 0 7 0 0 0 2 2 2 0 0 0 0 0 0 | |
0 0 0 0 0 0 0 0 0 2 2 2 0 0 0 | |
2 2 2 0 0 0 0 0 0 0 0 0 2 2 2 |
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
// challenge 277 hard 2016-07-29 /r/dailyprogrammer https://redd.it/4v5h3u | |
// compile: $ gcc -std=c99 challenge277.c -lm | |
// outputs to: fractal.tga | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <complex.h> |
OlderNewer