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
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; |
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
/* | |
Example usage: | |
Note: in all of these cases, the return value must be `Result<T, E>` where: | |
- `T` has a conversion to `AlgoOutput` (e.g. String, Vec<u8>, JsonValue, (), or anything Serializeable) | |
- `E` has a conversion to `Box<Error>` (e.g. String or any custom type that `impl Error`) | |
-------------Text----------------------- | |
algo_entrypoint! { text => hello } | |
fn hello(input: &str) -> Result<String, String> { | |
Ok(format!("Hello {}", input)) |
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
#![feature(test)] | |
extern crate serde_json; | |
extern crate json; | |
extern crate test; | |
#[cfg(test)] | |
mod tests { | |
use json::{self, JsonValue}; | |
use serde_json::{self, Value}; | |
use test::Bencher; |
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
extern crate libwkhtmltox_sys as libwkhtmltox; // https://github.com/anowell/libwkhtmltox-sys | |
use libwkhtmltox::*; | |
use std::ffi::{CString, CStr}; | |
use std::os::raw::{c_char, c_int, c_uchar}; | |
unsafe extern fn finished_callback(converter: *mut wkhtmltopdf_converter, val: c_int) { | |
println!("finished_callback: {}", val); | |
// Read the PDF output |
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
# Add to .bashrc or .profile or .zshrc or whatever you use... :) | |
# | |
# Examples: | |
# acurl algo/anowell/Pinky -X POST -d '"pondering"' -H "Content-Type: application/json" | |
# acurl data/.my/some_collection?force=true -X DELETE | |
function acurl() { | |
local aroute=$1 | |
local ahost=${ALGORITHMIA_API-https://api.algorithmia.com} | |
shift |
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
# -*- coding: utf-8 -*- | |
import random | |
def apply(input): | |
if "ponder" in input: | |
mesg = ponderings[random.randint(0,len(ponderings)-1)] | |
else: | |
mesg = exclamations[random.randint(0,len(exclamations)-1)] |
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
#!/usr/bin/env ruby | |
WORDS = ['you', 'thou', 'you', 'they', 'this', 'that', 'here', 'there', 'who', | |
'what', 'where', 'when', 'how', 'not', 'all', 'many', 'some', 'few', 'other', | |
'one', 'two', 'three', 'four', 'five', 'big', 'long', 'wide', 'thick', 'heavy', | |
'small', 'short', 'narrow', 'thin', 'woman', 'man', 'man', 'child', 'wife', | |
'husband', 'mother', 'father', 'animal', 'fish', 'bird', 'dog', 'louse', 'snake', | |
'worm', 'tree', 'forest', 'stick', 'fruit', 'seed', 'leaf', 'root', 'bark', 'flower', | |
'grass', 'rope', 'skin', 'meat', 'blood', 'bone', 'fat', 'egg', 'horn', 'tail', | |
'feather', 'hair', 'head', 'ear', 'eye', 'nose', 'mouth', 'tooth', 'tongue', |
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
#!/bin/bash | |
#sets the victims desktop to beiber. | |
/usr/bin/curl https://gist.githubusercontent.com/jgagner/9393470/raw/6ea21b41c27f22cd9fd50d7659ab314b8bfd8403/belieber.jpg > /tmp/belieber.jpg.base64 | |
/usr/bin/base64 -D --input /tmp/belieber.jpg.base64 -o ~/belieber.jpg | |
/usr/bin/osascript -e "tell application \"System Events\" to set picture of every desktop to \"~/belieber.jpg\"" | |
#remind our victim they are beliebers |
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
# ------------------------------------------------------------------------------ | |
# FILE: anowell.zsh-theme | |
# DESCRIPTION: oh-my-zsh theme file. | |
# AUTHOR: Anthony Nowell (anowell@gmail.com) | |
# VERSION: 1.0.0 | |
# SCREENSHOT: | |
# ------------------------------------------------------------------------------ | |
prompt_context() { | |
local user=`whoami` |
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
#!/bin/sh | |
# | |
# My workflow: | |
# git checkout -b myfeature | |
# ...edit stuff...git commit...edit stuff...git commit...ready to ship... | |
# git ship myfeature -rpd | |
# | |
# It exits if the merge or rebase requires intervention, | |
# for merge: fix the conflict, commit the merge, and re-run the git ship command | |
# for rebase: clean up the conflict, run `git rebase --continue` and then re-run the git ship command |