Skip to content

Instantly share code, notes, and snippets.

View flanger001's full-sized avatar
🧱

David Shaffer flanger001

🧱
View GitHub Profile
@flanger001
flanger001 / php_net_easter_eggs.txt
Last active May 27, 2016 13:39
PHP.net keyboard shortcuts/easter eggs
up up down down left right left right b a [enter]
?
esc
j
k
G
g h
g g
g p
g n
@flanger001
flanger001 / is_what_percent_of.rb
Created May 24, 2016 19:19
If you need to know what percentage one number is of another number
# Maybe not the worst monkey patch ever, but don't do this
class Numeric
def is_what_percent_of(num)
100 * (self.to_f/num)
end
end

Spicy Chicken Soup

Ingredients

  • 2 quarts water
  • 8 skinless, boneless chicken breast halves
  • 1/2 teaspoon salt
  • 1 teaspoon ground black pepper
  • 1 teaspoon garlic powder
  • 2 tablespoons dried parsley
<!DOCTYPE html>
<html ng-app='myApp'>
<head>
<title>Angular</title>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js'></script>
<script>
angular.module('myApp', [])
.controller('Person', function($scope) {
var data = {
name: 'John Smith',
@flanger001
flanger001 / springer-free-maths-books.md
Created December 29, 2015 14:06 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@flanger001
flanger001 / Fan Mail.md
Last active January 23, 2017 03:01
This is my bucket list that I accidentally wrote one day. I say "accidentally" because I didn't set out to write a bucket list, that's just what it became.
  • Mark Hamill - P.O. Box 287, Grand Blanc, MI 48480, USA
  • Harrison Ford - P.O. Box 49344, Los Angeles, CA 90049-0344, USA
  • Dave Grohl -
  • Josh Freese - Rebel Waltz, Inc., 31652 2nd Avenue, Laguna Beach, CA 92651, USA
  • Tom Hanks - Playtone, P.O. Box 7340, Santa Monica, CA 90406-7340, USA
  • Bill Murray - Ziffren, Brittenham, 1801 Century Park West, Los Angeles, CA 90067-6406, USA
  • Dan Akroyd - Applied Action Research Corp., 859 Hollywood Way, Box 497, Burbank, CA 91505, USA
  • John Cleese - Phil McIntyre Management Ltd., 3rd Floor, 85 Newman Street, London, W1T 3EU, UK
@flanger001
flanger001 / application.rb
Last active October 14, 2015 13:00
Dynamic error pages in Rails with testing
# in configure block
config.exceptions_app = self.routes
@flanger001
flanger001 / zalgo.js
Created September 23, 2015 14:05
I stole a Zalgo text generator
/* <![CDATA[ */
//============================================================
// ZALGO text script by tchouky
//============================================================
// data set of leet unicode chars
//---------------------------------------------------
//those go UP
var zalgo_up = [
@flanger001
flanger001 / rename_photos.rb
Created June 25, 2015 20:08
A script I wrote to convert files from IMG_XXXX.jpg to YYYY-MM-DD HH.MM.SS.jpg format, with proper duplicate file
require 'exifr'
files = Dir['*.jpg']
puts "Renaming #{files.count} files..."
new_file_names = Hash.new { |h,k| h[k] = [] }
files.each do |file|
exif = EXIFR::JPEG.new(file)
dt = exif.date_time_original
new_file_name = "#{dt.strftime('%Y-%m-%d %H.%M.%S')}"