This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to run | |
# In the folder with these files | |
# sudo python -m SimpleHTTPServer 80 | |
# | |
# Update the ip at the bottom of this file to the output of | |
# hostname -I | |
# This is your ip | |
# | |
# Start debian cd | |
# Press esc on menu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Prints speaker notes for a reveal.js presentation. | |
To print the notes, run the js function PrintRevealNotes() | |
You need to disable the pop-up blocker | |
Copyright 2016 Patrick G | |
http://geek1011.github.io | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
function jsonValue() { | |
KEY=$1 | |
num=$2 | |
awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'$KEY'\042/){print $(i+1)}}}' | tr -d '"' | sed -n ${num}p | |
} | |
if [ $# -eq 0 ]; then | |
echo Usage: $0 theme-name | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Swiper(el, left, right, up, down) { | |
var xD = null, | |
yD = null; | |
el.addEventListener("touchstart", function(ev) { | |
xD = ev.touches[0].clientX; | |
yD = ev.touches[0].clientY; | |
}, false); | |
el.addEventListener("touchmove", function(ev) { | |
if (!xD || !yD) return; | |
var xU = ev.touches[0].clientX, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// processColor processes a legacy html color | |
// The legacy html colors apply only to colors in the bgcolor attribute | |
// | |
// Copyright 2017 Patrick G | |
// Based on http://scrappy-do.blogspot.ca/2004/08/little-rant-about-microsoft-internet.html | |
// Also see https://stackoverflow.com/questions/8318911/why-does-html-think-chucknorris-is-a-color | |
function processColor(color) { | |
// Remove the hash | |
color = color.replace("#", ""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let start = null | |
let end = null; | |
const el = document.body; | |
el.addEventListener('touchstart', event => start = event.changedTouches[0], false); | |
el.addEventListener('touchend', event => { | |
end = event.changedTouches[0]; | |
let hr = (end.screenX - start.screenX) / el.getBoundingClientRect().width; | |
let vr = (end.screenY - start.screenY) / el.getBoundingClientRect().height; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
ballots = list(map(list, input("ballots: ").lower().replace(" ", "").split(","))) | |
candidates = list(set([candidate for ballot in ballots for candidate in ballot])) | |
winner, last_ballots = None, ballots | |
while winner == None: | |
ballots = [b for b in ballots if len(b) > 0] | |
fcs = [b[0] for b in ballots] | |
fc_counts = {c: fcs.count(c) for c in candidates} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"crypto/ecdsa" | |
"crypto/elliptic" | |
"crypto/rand" | |
"crypto/tls" | |
"crypto/x509" | |
"crypto/x509/pkix" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Termux SMS Backup" | |
echo "Copyright 2018 Patrick Gaskin" | |
hash termux-sms-list || | |
pkg install termux-api && | |
hash jq || | |
pkg install jq && | |
termux-setup-storage && | |
termux-sms-list -l 999999 -t all | | |
jq 'group_by(.threadid) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"archive/zip" | |
"crypto/sha1" | |
"fmt" | |
"os" | |
) | |
func main() { |
OlderNewer