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 / 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
@Nilloc
Nilloc / bootable-lion.txt
Created July 20, 2011 05:00
Create A Bootable Mac OS X 10.7 Lion Flash Drive
http://subrosasoft.com/blog/2011/07/create-a-bootable-mac-os-x-10-7-lion-flash-drive/
1) Purchase and download Lion from the Mac App Store on any Lion compatible Mac running Snow Leopard.
2) Right click on “Mac OS X Lion” installer and choose the option to “Show Package Contents”
3) Inside the Contents folder, you will find a SharedSupport folder and inside the SharedSupport folder you will find the
InstallESD.dmg. This is the 10.7 Lion boot disc image.
4) Copy InstallESD.dmg to another folder like the Desktop. To do so, simply click and drag the file to the desired location