Skip to content

Instantly share code, notes, and snippets.

@ryanmjacobs
ryanmjacobs / PKGBUILD
Created August 29, 2014 04:40
Orpie PKGBUILD - Aug. 28, 2014
# Contributor: Kazuo Teramoto <kaz.rag gmail com>
# Contributor: scj <scj archlinux us>
# Contributor: tracer <jcdenton513 gmail com>
# Contributor: ryanjacobs <ryan.mjacobs gmail com>
# Maintainer: aksr <aksr at t-com dot me>
pkgname=orpie
pkgver=1.5.2
pkgrel=7
epoch=
pkgdesc="A console-based RPN (reverse polish notation) desktop calculator."
@ryanmjacobs
ryanmjacobs / PKGBUILD
Last active August 29, 2015 14:05
naken_asm 2014-07-05 PKGBUILD
# Author: mr1337357 <mr1337357@gmail.com>
# Author: ryanjacobs <ryan.mjacobs@gmail.com>
pkgname=naken_asm
pkgver=2014.07.05
pkgrel=1
pkgdesc="A raw, simple assembler supporting 65xx, ARM, dsPIC, MIPS, 8051/8052, and MSP430 instruction sets"
arch=('i686' 'x86_64' 'arm')
url="http://www.mikekohn.net/micro/naken_asm.php"
license=('GPL')
depends=('readline')
@ryanmjacobs
ryanmjacobs / permutations.sh
Last active May 19, 2021 12:09
displays all upper/lowercase permutations of a word
#!/bin/bash
str=${1^^} # convert to uppercase
len=${#str} # get length of string
for ((perm=0; perm <= len; perm++)); do
for ((i=0; i <= len; i++)); do
lower=${str,,} # convert to lowercase
# Uppercase n-th letter for permutation
#!/usr/bin/env node
/**
* sort_ip.js
*
* run with: 'node ./sort_ip.js'
*/
// compare function
var compare = function(a, b) {
var aa = a.split("."),
@ryanmjacobs
ryanmjacobs / .gitignore
Last active September 10, 2015 06:55
Simulate Rubik's Cubes using the two-cycle method.
.*.sw[op]
*.pdf
*.json
*.csv
@ryanmjacobs
ryanmjacobs / README.md
Last active August 29, 2015 14:14
Download all xkcd comics.
$ git clone https://gist.github.com/ryanmjacobs/50a7944e929c1329ad44 xkcd
$ cd xkcd
$ gem install colorize
$ chmod +x xkcd.rb
$ ./xkcd.rb

Some extra info if you're curious:

  • git clone ... xkcd grabs these files and puts them in a directory called xkcd.
@ryanmjacobs
ryanmjacobs / README.md
Last active August 29, 2015 14:14
Obama meme test
$ git clone https://gist.github.com/ryanmjacobs/78e23e05bba048292768 obama_meme_test
$ cd obama_meme_test
$ gem install meme_captain
$ chmod +x obama_meme.rb
$ ./obama_meme.rb
/**
* NOTE:
* The shell script at the bottom of the page is
* more reliable and less buggy. Go use that instead.
*
* Usage: pop [path to cd-drive]
* Compile: gcc pop.c -o pop
*/
#include <stdio.h>
enum states_t {
WAIT, /* Wait until the soil is dry, then take action. */
PUMP_BUFFER, /* Pump buffer reservoir until 90% capacity. */
WATER_SOIL /* Water the soil until it isn't dry anymore. */
};
enum states_t state = WAIT;
while (1) {
switch (state) {
# Contributor: Jakub Luzny <limoto94@gmail.com>
# Maintainer: SanskritFritz (gmail)
pkgname=sl-git
_gitname=sl
pkgver=5.02.r0.g0fd8d6f
pkgrel=1
pkgdesc='Steam Locomotive runs across your terminal when you type "sl" as you meant to type "ls"'
arch=('i686' 'x86_64' 'arm')
url="http://www.tkl.iis.u-tokyo.ac.jp/~toyoda/index_e.html"