Skip to content

Instantly share code, notes, and snippets.

@mdeland
mdeland / basic_query.csv
Last active March 23, 2020 03:33
Summarizing Data in SQL
date num_customers distinct_customers total_bananas total_revenue revenue_per_sale
2016-01-01 345 287 564 3689 6.54
2016-01-02 364 299 582 4080 7.01
... ... ... ... ... ...
@auremoser
auremoser / the_recompiler.md
Created October 28, 2015 06:45
Recompiler Interview

The Recompiler

###From JS to JewelBots: ####An Interview with Sara Chipps #####By: Aurelia Moser #####10/28/15

sara

Often, we index our achievements in moments of time that told us who we were. The day I met Sara Chipps was a moment like that for me, one of those formative episodes that prefigures a lot of what followed in my programming life. I related to Sara in ways I never related to my technical colleagues or my grad school cohort, because she was a very feminine and fascinating programmer, one who commanded a respect and a competence that I felt I lacked. That relationship built a pretty fun friendship and inspired me to make code a considerable part of my work output and extracurricular projects.

@joshuapekera
joshuapekera / sfweb.md
Created September 26, 2015 02:44
San Francisco webfont
@esamattis
esamattis / application.html.erb
Last active May 19, 2019 00:36
React hot reloading with Webpack for Ruby on Rails
<script charset="utf-8">
<% if ENV["RAILS_ENV"] == "production" %>
var script = "/react-app-bundle.js";
<% else %>
console.warn("Development mode. Make sure to start 'node devServer.js'");
var script = "http://" + (location.host || 'localhost').split(':')[0] + ":4000/react-app-bundle.js"
<% end %>
document.write('<script src="' + script + '"></' + 'script>');
</script>
@enykeev
enykeev / invoice.yaml
Created September 22, 2015 15:51
YAML examples
--- !clarkevans.com/^invoice
invoice: 34843
date : 2001-01-23
bill-to: &id001
given : Chris
family : Dumars
address:
lines: |
458 Walkman Dr.
Suite #292

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@myronmarston
myronmarston / slash_vs_plus_string.rb
Last active May 20, 2016 00:27
Comparing perf of using `\` vs `+` for multiline strings
require 'benchmark/ips'
require 'allocation_stats'
def access_slashed_string
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis molestie " \
"elementum urna, a accumsan nunc euismod et. Aliquam porttitor, leo in " \
"aliquet aliquam, magna quam venenatis nulla, vel sagittis nisi nisi et " \
"nulla. Nulla quis facilisis turpis, vel blandit risus. Maecenas ut ante " \
"quis velit pretium pharetra ac rhoncus massa. Nulla quam dui, placerat " \
"eget quam vel, ultricies eleifend sem."
@SteveBenner
SteveBenner / pry-cheatsheet.md
Last active April 23, 2022 18:28 — forked from lfender6445/gist:9919357
Pry cheat sheet

Pry Cheat Sheet

Youtube Tutorial (2013)

Command Line

  • pry -r ./config/app_init_file.rb -- load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb -- load your rails into a pry session

Debugger

@mehdi-farsi
mehdi-farsi / proc_and_lambda.rb
Created December 9, 2014 16:53
Difference between Proc and Lambda
# Procs and Lambdas. They are both a Proc object.
#
# The main differences:
#
# 1- Lamdbas are strict about argument number instead of Procs.
# 2- Lambda :return returns out the scope. Proc :return returns out of the calling scope.
# Lamdbas are strict about argument number instead of Procs.
l = lambda { |word| puts word }
@speric
speric / gifts.md
Last active August 29, 2015 14:08
Gift Ideas For Young Engineers
  • Leatherman for young'ins ($54) Comes with the knife blade detached which can be added when 'earned:' http://gearjunkie.com/leatherman-leap-kids-multi-tool
  • Weather Lab ($15) This is more science oriented. Science can be boring at times, but carefully noting numbers and charting phenomenon to find correlation is a concept all should understand. www.smartlabtoys.com/you-track-it-weather-lab.html
  • Robo Link A ($25) Kit that builds five robot variations. It's not an intelligent (interactive) robot. It's mean to learn bout gears (mechanical engineering). www.makershed.com/products/robo-link-a
  • Lego Mindstorms EV3 ($350) shop.lego.com/en-US/LEGO-MINDSTORMS-EV3-31313 Ultimate lego kit, comes with motors, sensors and programmable controller which allows you to write programs and built ultimately anything (robots, machines, etc.). You can use their graphical programming language or venture out into RobotC, which is C-based. Make serious robots without electronics to get in the way.
  • **Flexbot