Skip to content

Instantly share code, notes, and snippets.

View kossnocorp's full-sized avatar
Shipping

Sasha Koss kossnocorp

Shipping
View GitHub Profile
git pull origin master && make clean && ./configure --with-features=huge --enable-cscope --enable-rubyinterp --enable-pythoninterp --enable-perlinterp && make && rm -rf /Applications/MacVim.app && mv ./src/MacVim/build/Release/MacVim.app /Applications
class String
def return_if expression
expression ? self : ''
end
end
@mathieul
mathieul / gist:966776
Created May 11, 2011 16:12
Require files using RequireJS before running Jasmine specs
/*
* jasmine.requirejs() returns a function that will load the file(s) required
* and will wait until it's done before proceeding with running specs.
* The function returned is intended to be passed to beforeEach() so the file(s)
* is(are) loaded before running each spec.
*
* Syntax:
*
* jasmine.requirejs(options, files)
* or
@evtuhovich
evtuhovich / gist:988261
Created May 24, 2011 07:28
Enabling russian in IRB
$ cd .rvm/src/ree-1.8.7-2011.03/source/ext/readline/
~/.rvm/src/ree-1.8.7-2011.03/source/ext/readline$ ls
~/.rvm/src/ree-1.8.7-2011.03/source/ext/readline$ brew install readline
Warning: Formula already installed: readline
~/.rvm/src/ree-1.8.7-2011.03/source/ext/readline$ ruby extconf.rb --with-readline-dir=/usr/local/Cellar/readline/6.2.1/
checking for tgetnum() in -lncurses... yes
[...skiped...]
creating Makefile
~/.rvm/src/ree-1.8.7-2011.03/source/ext/readline$ make
cc -dynamic -bundle -undefined suppress -flat_namespace -o readline.bundle readline.o -L. -L/Users/brun/.rvm/rubies/ree-1.8.7-2011.03/lib -L/usr/local/Cellar/readline/6.2.1//lib -L. -lreadline -lncurses -L/opt/local/lib -ldl -lobjc
#!/bin/sh
rvm_current=`rvm current`
echo "Installing ruby-debug with $rvm_current ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
gem install linecache19-0.5.13.gem ruby-debug-base19-0.11.26.gem ruby-debug19 -- --with-ruby-include=$rvm_path/src/$rvm_current
@gorkunov
gorkunov / gist:4225560
Created December 6, 2012 15:57
Smart Selection for VIM
" About:
"
" How often do you forget which keys you should use to select/modify strings
" in the ' or " or in other pairs? I often use viw/ciw instead of vi'/vi" for
" the first time because it easier for my fingers (but after that I remember
" about vi'). This script allows you always use the same shortcut for all
" cases. When you want to select string in the ' use viv. Do you want to
" select all in the '()'? Use viv. All in the '[]'? Use viv.
"
" How it works:
#!/usr/bin/env ruby
class RightTSnitch
# change me
def render
"#{bloody} #{power}#{battery} (~#{@percents}%)"
end
def initialize
do fn # if not returning value or I don't care
fn() # if returning value
fn 1
fn fn2()
fn(fn2(), 1)
fn fn2(1, 2, 3) # 4, 5 ...
@vjt
vjt / camelize.js
Created February 15, 2011 15:50
String.camelize
// I thought I needed it, but I didn't need it anymore,
// but I already implemented it. So, here we go, if you
// ever would need a Javascript camelize implementation
// you can freely use this :-).
// - vjt@openssl.it Tue Feb 15 16:49:52 CET 2011
jQuery.extend (String.prototype, {
camelize: function () {
return this.replace (/(?:^|[-_])(\w)/g, function (_, c) {
@okonet
okonet / lightning_talk_proposal.md
Last active April 10, 2018 10:09
Make linting great again! -- ReactiveConf 2017 ⚡️talk proposal

Please 🌟 this gist to vote for this proposal!

Make linting great again!

tabs vs spaces

No other topic in software development probably has so much controversy as linting.

With a wrong workflow linting can be really a pain and will slow you and your team down. With a proper setup, though, it can save you hours of manual work reformatting the code and reducing the code-review overhead.