Skip to content

Instantly share code, notes, and snippets.

@rf-
rf- / 00-README.md
Last active Mar 8, 2019 — forked from datanoise/crystal-tags.cr
Crystal ctags generator
View 00-README.md

To compile with Homebrew-installed LLVM:

PATH=/usr/local/opt/llvm/bin:$PATH crystal build crystal-tags.cr
@rf-
rf- / build.sbt
Last active Jun 25, 2016
Kalium issue repro
View build.sbt
scalaVersion := "2.11.8"
resolvers += "Sonatype" at "https://oss.sonatype.org/content/repositories/releases"
resolvers += "Twitter" at "https://maven.twttr.com/"
libraryDependencies ++= Seq(
"asm" % "asm" % "3.1",
"org.abstractj.kalium" % "kalium" % "0.4.0"
)
View nvim-client
#!/usr/bin/env python
import pynvim, os, re, sys, time
# Get a list of buffers that haven't been deleted. `nvim.buffers` includes
# buffers that have had `:bdelete` called on them and aren't in the buffer
# list, so we have to filter those out.
def get_listed_buffers(nvim):
return set(buf.number for buf in nvim.buffers \
if nvim.eval('buflisted(%d)' % buf.number))
@rf-
rf- / clickhole.user.js
Last active Aug 29, 2015
User script for revealing Clickhole quiz answers
View clickhole.user.js
// ==UserScript==
// @name Expose Clickhole Quizzes
// @namespace http://rynftz.gr
// @include *clickhole.com*
// @grant none
// ==/UserScript==
(function() {
$('#quiz .question .prompt').append(
$('<a href="#" class="expose-answers" style="font-size: 12px; display: block">Show Answers</a>')
@rf-
rf- / ResizingTextArea.css
Last active Aug 29, 2015
Resizing text area in JSX
View ResizingTextArea.css
.resizing-text-area__container {
position: relative;
}
.resizing-text-area__input {
height: 100%;
overflow: hidden;
position: absolute;
resize: none;
width: 100%;
View yardoc_cheatsheet.md

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

@rf-
rf- / base.rb
Last active Dec 19, 2015
Fragment-caching system for ActiveRecord
View base.rb
# encoding: UTF-8
# Caches::Base is the basis of a system for caching groups of view fragments.
# Classes that inherit from Caches::Base can manage the rendering of a group of
# related fragments (e.g., a list of papers) without wasting any Postgres
# queries or Memcached fetches.
#
# ### Defining A Subclass
#
# A subclass of Caches::Base represents a fragment of content, like a partial
View grd
#!/usr/bin/env ruby
# grd: micro Guard.
#
# Watch one or more filename patterns and then run the given command every time
# something changes.
#
# Example:
# grd my_model "rspec spec/models/my_model_spec.rb"
View .slate
# Configs
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
config windowHintsShowIcons true
# Aliases
alias showHintsLeftHand hint 0123456789QAZWSXEDCRFVTGB
# Abstract positions
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
View new_insert_before.rb
def insert_before(klass, options={})
instance = new(nil, options)
call_without = "call_without_#{instance.object_id}"
call_with = "call_with_#{instance.object_id}"
klass.class_eval do
define_method call_with do |env|
instance.app = proc { |env| send call_without, env }
instance.call(env)
end