Instantly share code, notes, and snippets.

# Aaron Francis aarondfrancis

Created February 28, 2012 16:24
What are the odds of pulling 3 1984 quarters out of a pile?
View Chances of pulling 3 1984 coins
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
 "Picked up 3 quarters from my spare change pile. They were all from 1984. What are the chances?!?!" [http://d.pr/9Trc] So first, we need to figure out how many quarters in any given pile should be dated 1984. Let's say that there are 65 billion quarters in circulation at the moment [1] and that there were 1.2 billion quarters minted in 1984 [2]. That means that 1.85% of the quarters in a given pile should be quarters with the date 1984. [1.2/65 = 1.85%]
Last active November 13, 2015 15:38
View gist:a21f04d869d04a8e8c6a
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
 "{\"APNS\":\"{\\\"aps\\\":{\\\"alert\\\":\\\"Delta Air Lines Flight 2537 will now depart from Gate 45 at 7:06 pm\\\",\\\"content-available\\\":1,\\\"sound\\\":\\\"default\\\"},\\\"traxo\\\":{\\\"notification_uuid\\\":\\\"f12718a8-30a4-47cb-b2b9-7165e6b2c48f\\\",\\\"notification_key\\\":\\\"flight_departure_gate_changed\\\",\\\"notification_level\\\":\\\"heads_up\\\",\\\"text\\\":\\\"{{ airline }} Flight {{ flight_number }} will now depart from Gate {{ departure_gate }} at {{ departure_time }}\\\",\\\"plain_text\\\":\\\"Delta Air Lines Flight 2537 will now depart from Gate 45 at 7:06 pm\\\",\\\"data\\\":{\\\"airline\\\":\\\"Delta Air Lines\\\",\\\"flight_number\\\":\\\"2537\\\",\\\"air_segment_id\\\":\\\"1025292\\\",\\\"departure_terminal\\\":\\\"B\\\",\\\"departure_gate\\\":\\\"45\\\",\\\"departure_time\\\":\\\"7:06 pm\\\",\\\"departure_time_zone_abbreviation\\\":\\\"EST\\\"},\\\"metadata\\\":{\\\"flight_number\\\":{\\\"value\\\":\\\"1025292\\\",\\\"type\\\":\\\"segment\\\"}}}}\",\"GCM\":\"{\\\"data\\\":{\\\"
Created November 18, 2015 01:16
View gist:a4cf36bcf175b2e3aea3
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
 {"params":{"TargetArn":"arn:aws:sns:us-west-2:954910203979:endpoint\/APNS\/Traxo_APNS_Prod\/49eed133-282d-3194-a526-2acdbba4585d","Message":"{\"APNS\":\"{\\\"aps\\\":{\\\"alert\\\":\\\"American Airlines Flight 2512 is on time for departure at 7:59 pm.\\\",\\\"content-available\\\":1,\\\"sound\\\":\\\"default\\\"},\\\"traxo\\\":{\\\"notification_uuid\\\":\\\"0aff976e-977a-452c-8eef-6fff59cc156c\\\",\\\"notification_key\\\":\\\"flight_departure_on_time\\\",\\\"notification_level\\\":\\\"success\\\",\\\"text\\\":\\\"{{ airline }} Flight {{ flight_number }} is on time for departure at {{ departure_time }}.\\\",\\\"plain_text\\\":\\\"American Airlines Flight 2512 is on time for departure at 7:59 pm.\\\",\\\"data\\\":{\\\"airline\\\":\\\"American Airlines\\\",\\\"flight_number\\\":\\\"2512\\\",\\\"air_segment_id\\\":\\\"1027796\\\",\\\"departure_time\\\":\\\"7:59 pm\\\",\\\"arrival_airport_code\\\":\\\"ATL\\\"},\\\"metadata\\\":{\\\"flight_number\\\":{\\\"value\\\":\\\"1027796\\\",\\\"type\\\":\\\"segment\\\"}}}}\"
Last active December 16, 2015 23:39
View gist:5515245

## web-boot.sh

``````for var in `env|cut -f1 -d=`; do
echo "PassEnv \$var" >> /app/apache/conf/httpd.conf;
done
touch /app/apache/logs/error_log
touch /app/apache/logs/access_log
touch /app/apache/logs/app_log
tail -F /app/apache/logs/error_log &
tail -F /app/apache/logs/access_log &amp;
``````
Last active February 7, 2017 16:26
View commitprint-ghe.js
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 (\$\$) { // Open a console in your web browser and paste // this entire script into it. This script doesn't // phone home at any point, you have to do that // manually. Still, give it a read. // `Cmd + Opt + J` on Chrome var user;
Created December 18, 2012 00:08
Inheritance in alloy?
View gist:4323639
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
 var App = require('application'); exports.definition = { config: { "adapter": { "type": "properties", "collection_name": "someChildClass" } }, extendModel: function(Model) {
Created January 10, 2022 23:19
View NoDownMigrationsTest.php
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

Created March 7, 2022 22:55
View hashdrop
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