Skip to content

Instantly share code, notes, and snippets.

View raws's full-sized avatar
🥯
dabbling in pumpernickel

Ross Paffett raws

🥯
dabbling in pumpernickel
View GitHub Profile
@raws
raws / chopt.rb
Last active November 12, 2016 22:52 — forked from prokop75/gist:a1e141c10b828d03ae74aca3f06e06e4
Chopt make order ahead orders not reorderable
chopt_location_ids = [5652, 6397, 6646, 6647, 6648, 6650, 6651, 6652, 6653,
6654, 7169, 7170, 7453, 7454, 7624, 7625, 7626, 7627, 7628, 7629, 7630,
7631, 7632, 7633, 8015, 8482, 10153, 10619, 10620, 10823, 10824, 11457,
11560, 14504, 14505, 14820, 15323, 17342, 22070, 22074, 22100, 22101]
orders = Order.completed.where(location_id: chopt_location_ids,
reorderable: true)
# Iterate through all orders, mark as reorderable = false, print IDs
orders.find_each do |order|
@raws
raws / treksubs.html
Last active December 19, 2015 07:48 — forked from anonymous/treksubs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Star Trek Subs</title>
<style type="text/css" media="screen">
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
require 'socket'
require 'timeout'
class MCQuery
MAGIC_PREFIX = "\xFE\xFD"
PACKET_TYPE_CHALLENGE = "\x09"
PACKET_TYPE_QUERY = "\x00"
ID = "\x00\x00\x00\x00"
DEFAULTS = {
host: "localhost",
@raws
raws / appify
Created May 11, 2013 23:06 — forked from mathiasbynens/appify
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@raws
raws / slugs.rb
Created December 25, 2012 01:53 — forked from bkerley/slugs.rb
> ruby slugs.rb
id: 1639513188
enciphered output, string-escaped for your convenience:
"X\xD0\x97N"
slug: lt1krc
decrypted id: 1639513188
the same?
true
@raws
raws / bijective.rb
Created December 25, 2012 00:58 — forked from zumbojo/bijective.rb
# Simple bijective function
# Basically encodes any integer into a base(n) string,
# where n is ALPHABET.length.
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047
ALPHABET =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//)
# make your own alphabet using:
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join
@raws
raws / curl.md
Created December 9, 2012 15:38 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
def device_exists?(subdomain, input_id, device_ip)
get_devices(subdomain, input_id).each do |dev|
return true if dev.has_value?(device_ip)
end
end
@raws
raws / gist:1421036
Created December 2, 2011 00:44 — forked from Arkaen/gist:1421029
CSS for Library Wobsite
head {
text-align: center;
}
a:link {
color: #0C1115;
text-decoration: none;
}
a:visited {
module Intercept
class << self
attr_reader :interceptors
def intercept(command, method=nil, &block)
interceptor = { :command => command, :action => method || block }
(@interceptors ||= []) << interceptor
end
end