Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am shadey on github.
  • I am shadey (https://keybase.io/shadey) on keybase.
  • I have a public key whose fingerprint is 9BF2 18B4 66B9 FC47 241B 8482 B9E2 F64B C2CA 4604

To claim this, I am signing this object:

#!/usr/bin/python
import tkinter as tk
from tkinter import filedialog
import os
try:
import requests
except ImportError:
print("No requests module.Try sudo pip install requests")
os.exit(1)
root = tk.Tk()
@Shadey
Shadey / jii.sh
Last active August 29, 2015 14:26
#!/usr/bin/sh
#requires imagemagick or scrot and curl xclip. Libnotify and a notification daemon should be nice
if [ -z $(command -v curl) ]; then echo "Please install curl"; exit;fi
if [ -z $(command -v scrot) ] && [ -z $(command -v import) ];then echo "Please install scrot or imagemagick";exit;fi
if [ -z $(command -v xclip) ]; then echo "Please install xclip to"; exit;fi;
tempfile="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1).png"
if [ ! -z $(command -v import) ]; then import $tempfile ; else scrot -s $tempfile; fi
res=$(curl -s "https://jii.moe/api/v1/upload" -F "file=@$tempfile")
url=$(python -c "import json;print(json.loads('$res')['url'])")
echo $url | xclip -selection clipboard
<div class="firmware-form">
<select data-id="0" name="five"><option value="OLD">OLD</option><option value="NEW">NEW</option></select>
<select data-id="1" name="zero"><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option></select>.
<select data-id="2" name="one"><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select>.
<select data-id="3" name="two"><option value="0">0</option></select>-
<select data-id="4" name="three"><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option></select>
<select data-id="5" name="four"><option value="E">E</option><option value="U">U</option><option value="J">J</option></select>
<button id="submit-button">Submit</button>
</div>
<div id="qr_code"></div>
package main
import (
"fmt"
"net/http"
)
func index(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Welcome to the Pi")
}
#!/bin/sh
usage(){ echo "Usage: $0 filename";exit 0;}
#Checks for only one args and thats the username
[ "$#" -ne 1 ] && usage || filename=$1
#Gets all the info from xwininfo to figure out how to crop the desktop
read x y w h <<<$(xwininfo | grep -e Width -e Height -e Absolute | awk -F ":" '{ print $2}' | awk '$1=$1')
#Uses ffmpeg to record the desktop with x11grab
ffmpeg -y -draw_mouse 0 -video_size $w'x'$h -f x11grab -i $DISPLAY.0+$x,$y -preset veryfast $filename
fn main(){
for x in 1..101{
match(x % 3, x % 5){
(0,0) => println!("FizzBuzz");
(0,_) => println!("Fizz");
(_,0) => println!("Buzz");
(_,_) => println!("{}",x);
}
}
}
extern crate rand;
extern crate time;
use rand::Rng;
use time::PreciseTime;
trait Swappable{
fn swap(&mut self,a:usize,b:usize);
}
impl Swappable for Vec<i32>{
#requies xclip curl and imagemagick
#!/usr/bin/sh
upload(){
res=$(curl -s "http://pomf.se/upload.php" -F "files[]=@$1")
IFS='"' read -a array <<< $res
link="http://a.pomf.se/${array[17]}"
echo $link
echo $link | xclip -selection c
}
file="kok.png"
*color0: #292929
*color8: #525252
! red
*color1: #cf6a4c
*color9: #ff9d80
! green
*color2: #99ad6a
*color10: #c3e6ad
! yellow
*color3: #fad07a