Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Artan Sinani rtsinani

🏠
Working from home
View GitHub Profile
View chalk.js.coffee
window.addEventListener "DOMContentLoaded", ->
body = $ "body"
canvas = $ "#canvas"
chalkboard = $ "#chalkboard"
close = $ "#close"
ledge = $ "#ledge"
lightswitch = $ "#lightswitch"
output = $ "#output"
shade = $ "#shade"
share = $ "#share"
@rtsinani
rtsinani / rbenv-howto.md
Created Nov 3, 2015 — forked from MicahElliott/rbenv-howto.md
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler
View rbenv-howto.md

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.
aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev
@rtsinani
rtsinani / cache.rake
Last active Dec 19, 2015
Rails 3.2 ceate static pages with page_cache and rake
View cache.rake
desc 'Generate the static pages'
task :cache => :environment do
pages = %w(404 422 500)
app = Rails.application
app.config.action_controller.perform_caching = true
session = ActionDispatch::Integration::Session.new(app)
pages.each { |page| puts session.get("/#{page}") }
end
@rtsinani
rtsinani / pre-commit
Last active Oct 18, 2017
Run rubocop on `git commit` (add to the `/.git/hooks` folder of your app)
View pre-commit
#!/bin/sh
#
# Check for ruby style errors
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
NC='\033[0m'
if git rev-parse --verify HEAD >/dev/null 2>&1
You can’t perform that action at this time.