Skip to content

Instantly share code, notes, and snippets.

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" update ack command to be able to search through the gem files
:autocmd BufEnter * call SetCurrentGemHome()
function! SetCurrentGemHome()
call UpdateGemPath()
:command! -nargs=* AckGems execute 'Ack' <q-args> $GEM_PATH
endfunction
function! UpdateGemPath()
let $GEM_PREFIX=system("rbenv prefix")
@ilyakatz
ilyakatz / Readme.md
Last active March 5, 2020 12:19
MixPanel job for Dashing

Description

Simple Dashing job to display total number of events in MixPanel .

##Preview

##Dependencies

@ilyakatz
ilyakatz / chrubuntu12.04.md
Last active December 17, 2015 05:59
html5 video

Ubuntu 12.04 on Samsung ChromeBook

Prerequisites

  • perform system update
    • if you do it later it will ask for all kind of permissions to override various config files
    • change password for root
      • default password is user

###Fix trackpad sudo apt-get install git

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Phone = #777
ISDN = 0
Password = yourpassword
Username = XXX-XXX-XXXX
Modem = /dev/ttyUSB1
Baud = 921600
Stupid Mode = on
<!--
1. /System/Library/LaunchDaemons/nginx.plist
2. to load: sudo launchctl load -F /System/Library/LaunchDaemons/nginx.plist
3. to unload: sudo launchctl unload /System/Library/LaunchDaemons/nginx.plist
-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
#base on http://ariejan.net/2011/09/24/rspec-speed-up-by-tweaking-ruby-garbage-collection
class DeferredGarbageCollection
MEM_FREE_FOR_GC_THRESHOLD = (ENV['MEM_FREE_FOR_GC_THRESHOLD'] || 500).to_f
@@last_gc_run = Time.now
def self.start
GC.disable if MEM_FREE_FOR_GC_THRESHOLD > 0
end
@ilyakatz
ilyakatz / pre-commit
Last active February 22, 2023 14:51
helpful precommit hooks
#!/bin/bash -l
# A git hook script to find and fix trailing whitespace
# in your commits. Bypass it with the --no-verify option
# to git-commit
#
.git/hooks/pre-commit-master-no-no
if [[ $? == 1 ]]
then
@ilyakatz
ilyakatz / routes.rb
Created January 4, 2013 21:28
script to determine all controllers in challengepost
def add_controllers(routes, all_controllers)
routes.each do |route|
requirements = route.requirements
controller_name = requirements[:controller]
action = requirements[:action]
if controller_name
all_controllers << "#{controller_name.camelize}Controller##{action}"
end
end
end
test:
solr:
hostname: localhost
port: 8994
log_level: WARNING
development:
solr:
hostname: localhost
port: 8993
@ilyakatz
ilyakatz / eydeploy.rb
Created December 12, 2012 16:46
Selective skip of asset compilation
#You'll need to add an eydeploy.rb with this file in either your root directory or in the config directory
module EY
module Serverside
class Task
def app_needs_assets_when_changed?
assets_modified = run "git diff --name-only #{last_revision} | grep '/assets/' | wc -l"
if assets_modified.output.to_i > 0
# Call the original method to preserve behaviour.