Skip to content

Instantly share code, notes, and snippets.

View SmugZombie's full-sized avatar

Ron Egli SmugZombie

View GitHub Profile
@SmugZombie
SmugZombie / encoded_local_storage_expiration.js
Last active July 9, 2018 21:26
Uses base64 to encode both local storage names and contents.
function getLocalStorage(name){
name = btoa(name);
var now = parseInt(new Date() / 1000);
var expires = localStorage.getItem(name+"_expire");
if(localStorage.getItem(name) === null){ return ""; }
if(!expires){ try { return atob(localStorage.getItem(name)); } catch(err){ return localStorage.getItem(name); } }
else if(now >= expires){ localStorage.removeItem(name+"_expire"); localStorage.removeItem(name); return ""; }
else{ try {return atob(localStorage.getItem(name));} catch(err){return localStorage.getItem(name);} }
}
@SmugZombie
SmugZombie / function.php
Created June 19, 2018 23:15 — forked from swapnilshrikhande/function.php
Send mail with mailgun api by PHP CURL.
<?php
define('MAILGUN_URL', 'https://api.mailgun.net/v3/DOMAIN_NAME');
define('MAILGUN_KEY', 'KEY');
function sendmailbymailgun($to,$toname,$mailfromnane,$mailfrom,$subject,$html,$text,$tag,$replyto){
$array_data = array(
'from'=> $mailfromname .'<'.$mailfrom.'>',
'to'=>$toname.'<'.$to.'>',
'subject'=>$subject,
'html'=>$html,
@SmugZombie
SmugZombie / linked_in_browser.js
Created February 27, 2018 23:40
Browse linked in without needing to login.
// ==UserScript==
// @name Linked In Browser (No Login)
// @namespace http://egli.me/
// @version 0.1
// @description Allows you to browse linked in without being logged in.
// @author Smugzombie
// @match https://www.linkedin.com/in/*
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
function rotate () {
# minimum file size to rotate in MBi:
local MB="$1"
# filename to rotate (full path)
local F="$2"
local msize="$((1024*1024*${MB}))"
test -e "$F" || return 2
local D="$(dirname "$F")"
local E=${F##*.}
@SmugZombie
SmugZombie / getSSID.py
Created January 27, 2018 00:31
Gets the SSID for use with Python Scripts on Raspberry Pi
import subprocess
def getSSID():
return str(subprocess.check_output(["/sbin/iwgetid -r"], shell = True).rstrip())
def main():
print getSSID()
main()
@SmugZombie
SmugZombie / clicktime_monitor.js
Last active January 3, 2018 22:44
Simple script which checks every few seconds to see if an asset only a logged in user can see is available, if not refreshes the page to prevent confusion.
// ==UserScript==
// @name Clicktime Monitor
// @namespace gist.github.com/smugzombie/13d5f60899d7aa0ee33bf9614ebb8520
// @version 0.1
// @description Monitors Your Login Status Within Clicktime to prevent filling out a days worth of time and it not saving
// @author Ron Egli
// @match https://app.clicktime.com/App/DayView/*
// @grant none
// ==/UserScript==
<div class='row'>
<div class="col-lg-12">
<ul class="nav nav-pills" style="border-bottom: 1px solid #007bff;">
<li class="nav-item">
<a class="nav-link active makeshift-tab" id='profile_pill' onclick='changePills(this.id)' href="#">User Profile</a>
</li>
<li class="nav-item">
<a class="nav-link makeshift-tab" id='contacts_pill' onclick='changePills(this.id)' href="#">Contacts</a>
</li>
<li class="nav-item">
@SmugZombie
SmugZombie / RickRoll.sh
Created October 18, 2017 20:03
Used to prank co-workers
!/bin/sh
open https://www.youtube.com/watch?v=dQw4w9WgXcQ
osascript -e 'tell app "System Events" to display dialog "Never gonna give you up" buttons {"OK"} with title "Rick Astley Says" with icon 0';
osascript -e 'tell app "System Events" to display dialog "Never gonna let you down" buttons {"OK"} with title "Rick Astley Says" with icon 0';
osascript -e 'tell app "System Events" to display dialog "Never gonna run around and desert you" buttons {"OK"} with title "Rick Astley Says" with icon 0';
osascript -e 'tell app "System Events" to display dialog "Never gonna make you cry" buttons {"OK"} with title "Rick Astley Says" with icon 0';
osascript -e 'tell app "System Events" to display dialog "Never gonna say goodbye" buttons {"OK I get it"} with title "Rick Astley Says" with icon 0';
osascript -e 'tell app "System Events" to display dialog "Never gonna tell a lie" buttons {"No really"} with title "Rick Astley Says" with icon 0';
osascript -e 'tell app "System Events" to display dialog "And hurt you" buttons {"
<?php
// Used for testing ratelimiting of auto submission contact scripts
// Generates believable email addresses using the top email services around the world
$attack_url = "http://example.com/php/contact-form-process.php"; // Url of the form submission page
$attack_quantity = 200; // Amount of posts to make in one call
$attack_wait = 5; // Seconds to wait between posts
$domains = array("aol.com", "att.net", "comcast.net", "facebook.com", "gmail.com", "gmx.com", "googlemail.com", "google.com", "hotmail.com", "hotmail.co.uk", "mac.com", "me.com", "mail.com", "msn.com", "live.com", "sbcglobal.net", "verizon.net", "yahoo.com", "yahoo.co.uk", "email.com", "fastmail.fm", "games.com", "gmx.net", "hush.com", "hushmail.com", "icloud.com","iname.com", "inbox.com", "lavabit.com", "love.com", "outlook.com", "pobox.com", "protonmail.com", "rocketmail.com", "safe-mail.net", "wow.com", "ygm.com", "ymail.com", "zoho.com", "yandex.com", "bellsouth.net", "charter.net", "cox.net", "earthlink.net", "juno.com", "btinternet.co
@SmugZombie
SmugZombie / GhettoCatFacts.go
Last active October 11, 2017 00:27
Adds CatFacts to Slack without the need to burn an app (for poor people like us)
package main
// Ghetto Cat Facts
// Allows random catfacts to be added to slack conversations without
// Ron Egli - github.com/smugzombie
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/json"