Skip to content

Instantly share code, notes, and snippets.

View listochkin's full-sized avatar

Андрей Листочкин (Andrei Listochkin) listochkin

View GitHub Profile
fxposter / base.rb
Created October 22, 2015 11:19
Default Rails template
View base.rb
# rails new app_name -d mysql --skip-bundle -m path/to/this/template.rb
comment_lines 'Gemfile', "gem 'turbolinks'"
comment_lines 'Gemfile', "gem 'jbuilder'"
comment_lines 'Gemfile', "gem 'sass-rails'"
comment_lines 'Gemfile', "gem 'coffee-rails'"
comment_lines 'Gemfile', "gem 'uglifier'"
comment_lines 'Gemfile', "gem 'sdoc'"
gsub_file 'Gemfile', "gem 'mysql2'", "gem 'mysql2', '~> 0.3.20'"
rwjblue /
Last active December 1, 2015 15:57
Canary Base
steveklabnik /
Created September 29, 2015 14:39
my summary of "using Rust with Ruby: a deep dive with Yehuda Katz"

My summary of


Rails has a library, ActiveSupport, which adds methods to Ruby core classes. One of those methods is String#blank?, which returns a boolean (sometimes I miss this convention in Rust, the ?) if the whole string is whitespace or not. It looks like this:

It's pretty slow. So Discourse (which you may know from {users,internals} uses the fast_blank gem, which provides this method via a C implementation instead. It looks like this:

For fun, Yehuda tried to re-write fast_blank in Rust. Which looks like this:

timcharper / Makefile
Created September 20, 2015 21:33
multirust source downloader
View Makefile
# Save this file to ~/.multirust/Makefile
# to run, cd ~/.multirust; make toolchains/1.3.0/src
.PHONY: clean
git clone --bare
toolchains/nightly/src: toolchains/master/src
ln -sf $$(pwd)/toolchains/master/src $$(pwd)/$@
View mixin-test.js
import Ember from 'ember';
import StartExamMixin from '../../../mixins/start-exam';
import { module, test } from 'qunit';
import sinon from 'sinon';
const {
} = Ember;
View gist:64ef5320e87c4b09772a
Thank you for extending an invitation to speak at HighLoad++. I
sincerely appreciate your consideration.
I am an outspoken advocate for LGBTQ equality; this position is deeply
woven into my work. Clojure From The Ground Up is adamantly
LGBT-inclusive. Jepsen is named after a gay pop anthem and includes
dozens of references to same-sex relationships and trans identities. My
talk slides are populated with bearded nuns, genderqueer punks, and
trans hackers. My twitter feed is about as gay as it is possible to get.
beshkenadze /
Last active August 29, 2015 14:23
Compare the services to collect errors.
View smart-wrapper.js
// Have some complicated non-React widgets that manipulate DOM?
// Do they manage a list of DOM elements? Here's how to wrap it
// into a React component so you can "constantly rerender" it.
// A dumb non-react widget that manually manage some DOM node that
// represent a list of items
function NonReactWidget(node) {
this.node = node;
View gist:61935031ff729f072d9b

When a beginner asks you "when do I use semi-colons?" would you rather say this?

// what people who say "use semicolons!!" say
class Foo {
  prop = {
  }; // yes