Skip to content

Instantly share code, notes, and snippets.

View IsaacG's full-sized avatar

Isaac Good IsaacG

View GitHub Profile
@IsaacG
IsaacG / picpaste.upload.bash
Created October 12, 2012 17:30
picpaste CLI command
#!/bin/bash
# storetime: 1:30m 2:1h 3:3h 4:6h 5:12h 6:1d 7:3d 8:7d 9:forever
# addprivacy: no:no 1:basic 2:strong 3:shorten
picpaste () {
opts=( -F storetime=1 -F addprivacy=1 -F rules=yes )
link=http://www.picpaste.com/upload.php
curl -sA firefox "${opts[@]}" -F upload=@"$1" "$link" \
| sed -n '/Picture URL/{n;s/.*">//;s/<.*//p}'
@IsaacG
IsaacG / pbin
Created November 15, 2012 02:41
A pastebin downloader
pbin ()
{
case "$1" in
http://pastebin.com/*)
url="http://pastebin.com/download.php?i=${1##*/}"
;;
http://pastebin.ca/*)
url="http://pastebin.ca/raw/${1##*/}"
;;
https://gist.github.com/*)
@IsaacG
IsaacG / fun.txt
Last active February 4, 2018 15:31
Imagine you are walking down the street and you see your neighbor building a house out of cardboard.
Your neighbor sees you and asks for help with something about building his house. Now, if your neighbor
says it is a fun project and just for the practice, you might say, "Sure, that looks fun. I'll try to
help you make a door that works." Or you might say, "Sorry, I'm busy. Maybe another time." However, if
your neighbor says he is building the house to live in it, that is an entirely different story. You
might laugh at him. You might try to explain that cardboard is not going to work as it rains most weeks.
You might try to convince him to use wood. So long as your neighbor thinks he will live in the house,
though, you will probably feel it is a waste of your time and his time to help him build that house.
If you got a project where you are doing something just because or for fun or to try something out or just
-- Q3: The prime factors of 13195 are 5, 7, 13 and 29.
-- What is the largest prime factor of the number 600851475143 ?
-- Q3 take1 (not used)
isDiv :: Int -> Int -> Bool
isDiv x y = mod x y == 0
factors :: Int -> [Int]
factors x = filter (isDiv x) [1,2..x]