Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
#!/usr/bin/env ruby | |
# Some members of ruby community continue to misunderstand the interplay of | |
# signal handlers and exception handling. This is a brief exploration | |
# via examples. You can run them by uncommenting the invocations at | |
# the bottom. You can see their behavior with Ctrl-C. | |
# | |
# Some of the examples will require a kill -9 from another terminal to | |
# stop. | |
# |
defmodule MyApp do | |
use Application | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
children = [ | |
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [ | |
dispatch: dispatch | |
]) |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
'use strict'; | |
// simple express server | |
var express = require('express'); | |
var app = express(); | |
var router = express.Router(); | |
app.use(express.static('public')); | |
app.get('/', function(req, res) { | |
res.sendfile('./public/index.html'); |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.
I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.
I'd love comments and suggestions about any of these.
I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.
I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".
byte[].metaClass.hexdump { int idx, int len -> | |
println ''' +--------------------------------------------------+ | |
| | 0 1 2 3 4 5 6 7 8 9 a b c d e f | | |
| +----------+--------------------------------------------------+------------------+'''.stripMargin() | |
delegate[ idx..<(idx+len) ].with { bfr -> | |
def bytes = bfr.collect { String.format( '%02x', it ) } | |
.collate( 8 ) | |
.collate( 2 ) | |
.collect { a, b -> ( a + [ '' ] + b ).join( ' ' ).padRight( 48, ' ' ) } | |
def ascii = bfr.collect { it > 0x1f && it < 0x7f ? (char)it : '.' } |
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list | |
# A list of available STUN server. | |
stun.l.google.com:19302 | |
stun1.l.google.com:19302 | |
stun2.l.google.com:19302 | |
stun3.l.google.com:19302 | |
stun4.l.google.com:19302 | |
stun01.sipphone.com | |
stun.ekiga.net |
module Kernel | |
def system(*args) | |
rd, wr = IO.pipe | |
# Create a new subprocess that will just exec the requested program. | |
pid = fork do | |
# The sub-process closes its copy of the reading end of the pipe | |
# because it only needs to write. | |
rd.close |