Skip to content

Instantly share code, notes, and snippets.

View adamfortuna's full-sized avatar

Adam Fortuna adamfortuna

View GitHub Profile
const uploaderMachine = Machine({
id: 'uploader',
initial: 'idle',
context: {
input: undefined,
payload: undefined,
activeImport: undefined,
message: undefined
},
states: {
@adamfortuna
adamfortuna / sp.csv
Last active July 9, 2019 17:26
S&P 500 Holdings
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
company,symbol,percent,sector,country,unknown,total_value,shares_count
"Microsoft Corp.","MSFT ","4.12%","Systems Software","US ","-","$18,483,420,677","149,445,510"
"Apple Inc.","AAPL ","3.40%","Technology Hardware, Storage & Periphera","US ","-","$15,275,900,917","87,255,960"
"Amazon.com Inc.","AMZN ","3.18%","Internet & Direct Marketing Retail","US ","-","$14,266,519,826","8,037,159"
"Facebook Inc. Class A","FB ","1.84%","Interactive Media & Services","US ","-","$8,246,541,793","46,467,244"
"Berkshire Hathaway Inc. Class B","BRK.B ","1.61%","Multi-Sector Holdings","US ","-","$7,230,767,700","36,626,318"
"Johnson & Johnson","JNJ ","1.52%","Pharmaceuticals","US ","-","$6,803,340,675","51,874,500"
"JPMorgan Chase & Co.","JPM ","1.48%","Diversified Banks","US ","-","$6,656,269,134","62,818,697"
"Alphabet Inc. Class C","GOOG ","1.47%","Interactive Media & Services","US ","-","$6,607,453,779","5,987,019"
"Alphabet Inc. Class A","GOOGL ","1.44%","Interactive
<?php
// What is this:
// Feedly shows an icon on the feed for each blog. If You have a logo in your webfeed then it'll show that logo.
// Add a namespace to the root tag. This allows you to use <webfeeds> tags later
add_filter( 'rss2_ns', 'feedly' );
function feedly() {
echo 'xmlns:webfeeds="http://webfeeds.org/rss/1.0"';
}
@adamfortuna
adamfortuna / rocket.rb
Last active July 13, 2016 01:10
Unicode characters as methods
class Launcher
def 🚀 🛩
puts "Launching #{🛩}"
end
end
🚂 = Launcher.new
🚂.🚀 "🛰"
@adamfortuna
adamfortuna / lol.js
Last active February 18, 2016 01:29 — forked from wesbos/lol.js
// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = document.getElementsByTagName('body')[0].textContent;
this.speak(msg);
};
diff --git a/unmasking_html_emails/scratch.html b/unmasking_html_emails/scratch.html
index 1a7ab8f..7d6fb1a 100644
--- a/unmasking_html_emails/scratch.html
+++ b/unmasking_html_emails/scratch.html
@@ -39,6 +39,11 @@
.client-link a {
color: #3a383a !important;
}
+
+ td {
t = [1,2,3]
[1, 2, 3]
t[0.5]
undefined
@adamfortuna
adamfortuna / 7-7.js
Created September 18, 2012 14:00
Backbone course answer
var AppRouter = new (Backbone.Router.extend({
routes: { "appointments/:id": "show", "": "index" },
initialize: function(options){
this.appointmentList = new AppointmentList();
},
start: function(){
Backbone.history.start({pushState: true});
},
@adamfortuna
adamfortuna / test.css
Created April 5, 2012 00:27
Testing this out
body { font-size: 62.5%; }
@adamfortuna
adamfortuna / config.ru
Created February 29, 2012 17:48
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
require "rails"
# Let's load only action controller. If you want
# to use active record, just require it as well.
require "action_controller/railtie"
class MyApp < Rails::Application