Skip to content

Instantly share code, notes, and snippets.

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active February 25, 2024 13:47
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@drtoast
drtoast / gist:7159912
Created October 25, 2013 18:54
Jailbreaking a Google Search Appliance
These are my notes from my abandoned project to wipe and reuse a Google Search Appliance:
Dell PowerEdge 2950 (model EMS01)
http://support.dell.com/support/edocs/systems/pe2950/en/hom/html/index.htm
Disable BIOS Password
http://support.dell.com/support/edocs/systems/pe2950/en/hom/html/jumpers.htm#wp1054535

This document is intended to be a simplified version of the OAuth 2.0 specification. In particular it has been written with implementors in mind, and as such attempts to trim the spec down to just what you need to implement an OAuth provider or client. It is necessarily not complete, but attempts to introduce spec requirements in the same order in which the protocol proceeds in practise, with everything you need to know about each protocol endpoint brought together in one place rather than scattered across a large document.

@fnichol
fnichol / README.md
Created February 26, 2012 01:23
A Common .ruby-version File For Ruby Projects

A Common .ruby-version File For Ruby Projects

Background

I've been using this technique in most of my Ruby projects lately where Ruby versions are required:

  • Create .rbenv-version containing the target Ruby using a definition name defined in ruby-build (example below). These strings are a proper subset of RVM Ruby string names so far...
  • Create .rvmrc (with rvm --create --rvmrc "1.9.3@myapp") and edit the environment_id= line to fetch the Ruby version from .rbenv-version (example below).

Today I learned about another Ruby manager, rbfu, where the author is using a similar technique with .rbfu-version.

@bunnymatic
bunnymatic / gist:1648765
Last active February 22, 2020 21:03
compute histogram in ruby
def tally inp; hash = Hash.new(0); inp.each {|k,v| hash[k] +=v}; hash; end
def histogram inp; hash = Hash.new(0); inp.each {|v| hash[v]+=1}; hash; end
def histogram2 inp; Hash[*inp.group_by{ |v| v }.flat_map{ |k, v| [k, v.size] }] end
def test_tally
tally([['a',1],['b',1],['a',1],['c',1],['a',3], ['c',1]]) == {'a'=>5, 'b'=>1, 'c'=>2}
end
def test_histogram
histogram(['a','b','a','c','a', 'c']) == {'a'=>3, 'b'=>1, 'c'=>2}
@rudyjahchan
rudyjahchan / Rakefile
Created June 9, 2011 16:45
Building and Deploying iOS Projects through Rake
require 'yaml'
require 'uri'
require 'tempfile'
require 'tmpdir'
SDK_DIR = "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk"
TESTFLIGHT_URL = 'http://testflightapp.com/api/builds.json'
PROJECT_DIR = File.dirname __FILE__
RUBIOS_DIR = File.join(PROJECT_DIR, 'rubios')
module Paperclip
class Geometry
def self.from_file file
parse("100x100")
end
end
class Thumbnail
def make
src = Test::FileHelper.fixture_file('white_pixel.jpg')
dst = Tempfile.new([@basename, @format].compact.join("."))