Skip to content

Instantly share code, notes, and snippets.

@rapsad
rapsad / LICENSE
Created August 4, 2017 09:05 — forked from shevron/LICENSE
Send EC2 instance memory usage stats to CloudWatch using boto and IAM Roles
Copyright (c) 2015, Shahar Evron
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
# simple delegator
class Profile < SimpleDelegator
def title
"#{first_name} #{last_name}'s profile"
end
end
# controller
class ProfilesController < ApplicationController
def show
@rapsad
rapsad / Gulpfile.js
Created January 23, 2016 21:10 — forked from voter101/Gulpfile.js
Gulpfile for Rails application with replaced Sprockets with Gulp
'use strict'
var gulp, sass, babelify, browserify, watchify, source, util;
gulp = require('gulp');
sass = require('gulp-sass');
babelify = require('babelify')
browserify = require('browserify');
watchify = require('watchify');
source = require('vinyl-source-stream');
@rapsad
rapsad / Preferences.sublime-settings
Last active November 14, 2015 21:35
Sublime user settings
{
"auto_complete_delay": 500,
"csslint_options":
{
"adjoining-classes": "warning",
"box-model": true,
"box-sizing": "warning",
"compatible-vendor-prefixes": "warning",
"display-property-grouping": true,
"duplicate-background-images": "warning",
@rapsad
rapsad / index.html
Last active September 15, 2015 15:49 — forked from dnprock/index.html
World Map
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 960px;
height: 500px;
position: relative;
}
GIT
remote: git://github.com/Apipie/apipie-rails.git
revision: becc75b5f02663a1473ee94c0fbb98a82a2ce7bd
specs:
apipie-rails (0.3.4)
json
GIT
remote: git://github.com/carrierwaveuploader/carrierwave.git
revision: 05cd850e7517d1f4acdcb25002efd339bc9ed3b0
# Could not find Firefox binary (os=linux). Make sure Firefox is installed or set the path manually with Selenium::WebDriver::Firefox::Binary.path= (Selenium::WebDriver::Error::WebDriverError)
require 'selenium-webdriver'
Selenium::WebDriver::Firefox::Binary.path='/usr/bin/firefox-developer'
@rapsad
rapsad / vim.md
Last active August 29, 2015 14:21
Vim gist
Ctrl+X Ctrl+O (in insert mode) -> Ruby Complemention

New empty file:

:new

Moving between tabs:

@rapsad
rapsad / tmux.md
Last active August 29, 2015 14:21 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

require 'date'
public
print "Enter a year: "
arr = [2000, 2004, 1900, 2005]
minutes_leap_year = 366*24*60
minutes_nleap_year = 365*24*60
puts "\n"