Skip to content

Instantly share code, notes, and snippets.

View Nilloc's full-sized avatar

Collin Reisdorf Nilloc

View GitHub Profile
anonymous
anonymous / auto_orient.rb
Created May 10, 2010 19:27
module Paperclip
class AutoOrient < Paperclip::Processor
def initialize(file, options = {}, *args)
@file = file
end
def make( *args )
dst = Tempfile.new([@basename, @format].compact.join("."))
dst.binmode
@makevoid
makevoid / Gemfile
Created September 12, 2011 02:59
Rails 3.1 Gemfile with DataMapper, RSpec, Haml, Sass, CoffeeScript and Thin (in dev)
source 'http://rubygems.org'
gem 'activesupport', :require => 'active_support'
gem 'actionpack', :require => 'action_pack'
gem 'actionmailer', :require => 'action_mailer'
gem 'railties', :require => 'rails'
gem 'mysql2'
DM_VERSION = '~> 1.2.0.rc1'
@Nilloc
Nilloc / gist:1336952
Created November 3, 2011 16:23
Fadeout and remove objects.
$('#glass').mousedown(function(evt){
var $thumb = $('<img src="img/thumbprint.png" class="thumbprint">')
.css({top:evt.offsetY-30, left:evt.offsetX-20, opacity:1, rotation:90}) //, "-webkit-transform": "rotate("+((Math.random()*30)-15)+" deg)"
.delay(1000)
.animate({opacity:0}, 2000, function(){$(this).remove();});
$(this).append($thumb);
});
@hipertracker
hipertracker / vimeo_downloader.rb
Created January 3, 2012 20:06
Vimeo Downloader
#!/usr/bin/env ruby
=begin
Vimeo Downloader v1.0 by Jaroslaw Zabiello (http://zabiello.com)
based on http://cl.ly/2T1x180I251j301L1C3r/vimeo_downloader.sh
found thanks to http://goo.gl/AN5sf :)
Requirements:
* Ruby 1.8 or newer
* nokogiri (http://nokogiri.org)
@mjackson
mjackson / color-conversion-algorithms.js
Last active July 22, 2024 15:04
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@lopezjurip
lopezjurip / gist:a817e96ec833e7667274
Last active June 9, 2020 22:26
DigitalOcean+Rails+Puma+Dokku+Postgress
# Based on: http://donpottinger.net/blog/2014/11/17/bye-bye-heroku-hello-dokku.html
# Add to gemfile:
ruby '2.1.2'
gem 'pg'
gem 'puma'
gem 'rails_12factor'
gem 'searchkick'
gem 'typhoeus'
@nitaku
nitaku / README.md
Last active May 8, 2023 17:59
Three.js isometric SVG

An example showing an isometric rendering in SVG, thanks to three.js.

The example is inspired by this post on using three.js to generate illustrations for scientific papers.

@jamescmartinez
jamescmartinez / slack_delete.rb
Last active May 28, 2024 15:00
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@0x1ad2
0x1ad2 / Gulpfile.js
Last active January 23, 2020 15:24
My gulpfile example for How to enhance your front-end development workflow using Gulp
/*
* 0x1ad2 base Gulp.js file
* https://twitter.com/0x1ad2
*/
/*
* Define plugins
*/
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
@Nilloc
Nilloc / gist:aacdab06bcbee5d3ef01
Created March 16, 2016 17:39 — forked from lopezjurip/gist:a817e96ec833e7667274
DigitalOcean+Rails+Puma+Dokku+Postgress
# Based on: http://donpottinger.net/blog/2014/11/17/bye-bye-heroku-hello-dokku.html
# Add to gemfile:
ruby '2.1.2'
gem 'pg'
gem 'puma'
gem 'rails_12factor'
gem 'searchkick'
gem 'typhoeus'