Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am imryan on github.
  • I am imryan (https://keybase.io/imryan) on keybase.
  • I have a public key whose fingerprint is 6FCB A25E AABD B463 C0BB 04FD 3688 04C6 B8E1 9A08

To claim this, I am signing this object:

@imryan
imryan / paybear-qr.swift
Last active February 28, 2018 19:11 — forked from aamnah/google_api_qrcode.php
Generate a QR code using Google Charts API (for Paybear transactions)
// Type
let cht = "qr"
// Size
let chs = "180x180"
// Transaction message
let chl = "ethereum:\(walletAddress)?amount=\(amount)&message=\(message)" // URL-encode
// Final URL
Verifying my Blockstack ID is secured with the address 14ygJVHjdmvvCxaucHqdbXYXa87EQzY5J3 https://explorer.blockstack.org/address/14ygJVHjdmvvCxaucHqdbXYXa87EQzY5J3
@imryan
imryan / insomnia.py
Last active July 4, 2017 20:30
Insomnia cookies order tracker tool
# insomnia.py
# by Ryan Cohen
import urllib2
import json
import sys
FIRST_ORDER_ID = 5521566
START_ID = 5520000
MULTIPLIER = 10000
@imryan
imryan / import_minimizer.rb
Created January 11, 2017 16:33 — forked from Orangenhain/import_minimizer.rb
Script that takes a ObjC .m file and tries to find unused (or duplicate) import statements by commenting out each #import line in turn and seeing if the project still compiles. You will have to change BUILD_DIR & BUILD_CMD.
#!/usr/bin/env ruby -w
class String
def starts_with?(prefix)
prefix.respond_to?(:to_str) && self[0, prefix.length] == prefix
end
end
HEADER_REGEX = /^#import\s+["<](.*)[">]/

Keybase proof

I hereby claim:

  • I am imryan on github.
  • I am imryan (https://keybase.io/imryan) on keybase.
  • I have a public key whose fingerprint is 9852 C9DD 92B9 B250 F4C3 0F02 E52E 50E8 A287 ECF4

To claim this, I am signing this object:

@imryan
imryan / Calc.java
Created January 7, 2014 17:51
CLI calculator that performs computations on one line.
import java.text.NumberFormat;
import java.util.Locale;
import java.util.Scanner;
public class ConsoleCalc {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
@imryan
imryan / greet.js
Created December 25, 2013 18:56
Simple Merry Christmas script.
function greet() {
var sleep = require('sleep');
var letters = [ "M", "E", "R", "R", "Y", " ",
"C", "H", "R", "I", "S", "T", "M", "A", "S" ];
for (var i = 0; i < letters.length; i++) {
sleep.usleep(100900);
process.stdout.write(letters[i] + " ");
}
}
@imryan
imryan / eject.py
Last active December 30, 2015 08:49
Opens and closes disk tray infinitely.
import ctypes
def eject():
opens = 0
closes = 0
while (True):
# Open disk tray
ctypes.windll.WINMM.mciSendStringW(u"open D: type cdaudio alias d_drive", None, 0, None)
@imryan
imryan / Coinflip.java
Created November 20, 2013 16:18
Coinflip program that was extremely necessary to complete.
import java.util.*;
public class Coinflip {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int sideNo = 0;
String side = "";
String landedSide = "";