Skip to content

Instantly share code, notes, and snippets.

View gingray's full-sized avatar
🎯
Focusing

Ivan gingray

🎯
Focusing
View GitHub Profile
@mikker
mikker / gist:1433300
Created December 5, 2011 11:30
Building MacVim and Command-T on Mac OS X with RVM
$ rvm use system
$ brew install macvim # remove old version first
$ cd ~/.vim/bundle/command-t/ruby/command-t # using pathogen to manage plugins
$ ruby extconf.rb && make # configure and build
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@bds
bds / gist:2207826
Created March 26, 2012 17:58
Convert files from .scss to .sass
sass-convert -F scss -T sass application_styles.css.scss application_styles.css.sass
@tony4d
tony4d / p4merge4git.md
Created August 24, 2012 19:00
Setup p4merge as a visual diff and merge tool for git
@uarun
uarun / intellij.md
Last active February 26, 2024 06:57
Intellij IDEA - Cheat Sheet (aka useful shortcuts)

Intellij IDEA - Cheat Sheet (aka most useful shortcuts)

Note: Some of these keymapping are specific to IdeaVim plugin. If you don't use IdeaVim (what' wrong with you :)), I've tried to point out where they differ, but I could have missed a few

Coding Session

Parameter documentation for Method Calls

  • Ctrl-P - Popup parameter documentation for method calls
@dmichael
dmichael / httpclient.go
Last active October 18, 2023 20:07
Light wrapper for the Go http client adding (essential) timeouts for both connect and readwrite.
package httpclient
import (
"net"
"net/http"
"time"
)
type Config struct {
ConnectTimeout time.Duration
@bgkittrell
bgkittrell / aws-transcode.rb
Created June 11, 2013 13:57
Uploads a directory of files to s3 and creates elastic transcoder jobs. Requires the aws-sdk gem. Usage ruby aws-transcode.rb /path/to/videos
require 'aws'
AWS.config(:access_key_id => 'XXXXX', :secret_access_key => 'XXXXX')
pipeline_id = 'XXXXXXX'
preset_id = 'XXXXXX'
s3 = AWS::S3.new
bin = s3.buckets['XXXXXX-in']
bout = s3.buckets['XXXXXX-out']
@jameslafa
jameslafa / admin-projects.rb
Created July 17, 2013 10:28
Paperclip with Rails4 and active admin
ActiveAdmin.register Project do
# Don't forget to add the image attribute (here thumbnails) to permitted_params
controller do
def permitted_params
params.permit project: [:title, :summary, :description, :thumbnail, :date, :url, :client_list, :technology_list, :type_list]
end
end
form do |f|
@bonyiii
bonyiii / gist:6184489
Created August 8, 2013 13:16
ruby multithread
http://speakmy.name/2013/04/02/concurrent-programming-and-threads-in-ruby-reading-list/
Concurrent Programming and Threads in Ruby - a reading list
02 April 2013
Many rubyists consider threads in Ruby as somewhat of an arcane knowledge, though in reality they’re a very well researched and understood concept. Of course, writing effective multithreaded concurrent programs requires certain amount of knowledge and discipline from the programmer, but there’s nothing that a smart one can’t learn if he wants to.
To help with the task, awesome @brainopia compiled a list of recommended reading on the topic of concurrency and threads. All kudos go to @brainopia, and the original list in Russian as available as a gist here:
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master