Skip to content

Instantly share code, notes, and snippets.

View mojowen's full-sized avatar
๐Ÿ•
๐Ÿค”

Scott Duncombe mojowen

๐Ÿ•
๐Ÿค”
View GitHub Profile
@mojowen
mojowen / load.sh
Last active March 18, 2016 22:39
Load ENV file into
#!/usr/bin/env bash
# Use on .env files, structured as KEY=VALUE. Will load into bash env
# Must be called with $ . load.sh
ENV_FILE=${1:-'./.env'}
cat $ENV_FILE | awk -F"=" '{print "Loading " $1}'
declare -a $(cat $ENV_FILE | awk -F"=" '{print $1"="$2}')
@mojowen
mojowen / byebye_itunes.sh
Last active March 28, 2016 16:53
Remove iTunes and prevent it from reinstalling it
#!/usr/bin/env bash
sudo rm -rf /Applications/iTunes.app
sudo echo "BAD APPLE! NO" > /Applications/iTunes.app
sudo chmod 000 /Applications/iTunes.app
sudo chflags uchg /Applications/iTunes.app
@mojowen
mojowen / no_genius.html
Created March 28, 2016 16:48
Add to your blog or website to prevent your site from being viewed on genius.it
<script type="text/javascript">
(function(doc) {
var flat = doc.location.toString()
if( flat.match(/genius\.it/) !== null ) document.location = flat.split('genius.it').join('/')
})(document)
</script>
@mojowen
mojowen / lead_dist_reducer_actions
Last active October 5, 2016 16:46 — forked from DTwigs/lead_dist_reducer_actions
Leads Reducer Actions and APi Calls
Leads Actions:
------------
GetLeads (URL: /locations/:location_id/leads?filter=<active|archived>)
------------
GetLead (URL: /locations/:location_id/leads/:lead_id)
@mojowen
mojowen / README.md
Last active October 3, 2016 18:11
Can You Vote?
@mojowen
mojowen / lead_details.json
Last active October 5, 2016 20:06 — forked from sfletche/lead_details.json
JSON response to a specific lead
{
"id": "00Q22000001GZsGEAW",
"status": null,
"lead_contact": {
"name": "test Test",
"phone": null,
"email": null
},
"archived": null,
"expire_at": null,
@mojowen
mojowen / preload_facebook_share_img.rb
Created October 11, 2016 21:33
The Facebook Sharer will not show a share image if the image is kind of large - this ruby function requests to share a URL programmatically so when a real users attempts to share the image will appear.
require 'rest-client'
def clear_url(url)
cookie = "" # Load facebook and copy and paste your session detail in here
cookie = Hash[ cookie.split('; ').map { |line| line.split('=') } ]
resp = RestClient.get "https://www.facebook.com/sharer/sharer.php?u=#{url}", { cookies: cookie }
raise 'whoops' if resp.code != 200
@mojowen
mojowen / index.html
Last active November 7, 2016 05:11
Fullpage JustVote
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true&libraries=geometry"></script>
<script src="http://justvotecolorado.org/justvote/js/electionMap.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript">
ElectionMap.prototype.config = {"types":{"drop off":{"long_title":"drop off","icon":"http://chart.apis.google.com\/chart?chst=d_map_pin_letter&chld=|00bdef"},"vote center":{"long_title":"vote center","icon":"http://chart.apis.google.com\/chart?chst=d_map_pin_letter&chld=|ff4429","default":"true"}},"states":["on","on"],"url":"https:\/\/spreadsheets.google.com\/feeds\/list\/1jCTNodsee2a36JrZaQ-QY0t4VN24cwP3VFi3gG77ixA\/ovnuykr\/public\/values"}
</script>
</head>
Verifying my Blockstack ID is secured with the address 1WaLst1EWmDVQfZXRidrHyJf8WtQcSzAG https://explorer.blockstack.org/address/1WaLst1EWmDVQfZXRidrHyJf8WtQcSzAG
export ME_EMOJI=(๐Ÿ• ๐Ÿ”ฅ ๐Ÿ’ช โ›ท ๐Ÿคท ๐Ÿคž ๐Ÿค” ๐Ÿค  ๐Ÿ‘ฉโ€๐ŸŽค ๐Ÿ‘พ ๐Ÿ‘ป ๐ŸŒŠ ๐Ÿš€ ๐Ÿ‘‰ ๐Ÿ—ฟ ๐Ÿฆ… ๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿš€ โ˜  ๐Ÿ˜‘ ๐Ÿ‘€ ๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ”ฌ โšก๏ธ โ˜ƒ๏ธ ๐ŸŒช ๐Ÿ’จ ๐ŸŒฎ ๐Ÿบ ๐Ÿฅƒ ๐ŸŠ๐Ÿปโ€โ™€๏ธ ๐Ÿ‹๐Ÿฝโ€โ™€๏ธ โ›บ๏ธ ๐ŸŒ‹ ๐Ÿ” ๐ŸŒ ๐Ÿž ๐Ÿ’ฃ)
RANDOM_ME_EMOJI=${ME_EMOJI[$((RANDOM%${#ME_EMOJI[@]}))]};
export PS1="${RANDOM_ME_EMOJI} \w $ "