Skip to content

Instantly share code, notes, and snippets.

View Nilloc's full-sized avatar

Collin Reisdorf Nilloc

View GitHub Profile
@Nilloc
Nilloc / cell-locate.cpp
Created October 23, 2018 18:19 — forked from technobly/cell-locate.cpp
Cellular Locate Test Application
/******************************************************************************
Copyright (c) 2015 Particle Industries, Inc. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, either
version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@Nilloc
Nilloc / color-conversion-algorithms.js
Created July 11, 2018 16:15 — forked from mjackson/color-conversion-algorithms.js
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
@Nilloc
Nilloc / post-merge
Last active May 9, 2016 20:10 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@Nilloc
Nilloc / config.json
Created April 18, 2016 19:09 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#413c2a",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#40a298, 6.5%)",
"@brand-success": "#5cb85c",
@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'
@Nilloc
Nilloc / Contract Killer 3.md
Last active September 14, 2015 16:29 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2014
  • Original post

@Nilloc
Nilloc / sketch.w
Created April 12, 2012 18:42 — forked from edbaafi/sketch.w
Untitled Project
/* Created with Modkit Classic
* Powered By Wiring Framework v1.0
* http://modk.it/classic/editor/
* Board: Arduino UNO
*************************************************************
* AUTOGENERATED BY MODKIT CLASSIC - DO NOT EDIT
*/
//new data
@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);
});
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