Skip to content

Instantly share code, notes, and snippets.

View flanger001's full-sized avatar
🧱

David Shaffer flanger001

🧱
View GitHub Profile
@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
<!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',

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
@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
@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
def caesar(key, text)
az = ('A'..'Z').to_a
rt = az.rotate(key)
chars = text.split('')
.select { |c| az.include?(c) }
.map { |c| rt[az.index(c)] }
.join('')
end
class String
def rotate_vowels(num = 1)
vowels = "aeiou"
uc_vowels = vowels.upcase
tr(uc_vowels, uc_vowels.chars.rotate(num).join).tr(vowels, vowels.chars.rotate(num).join)
end
end
str = "Hey, I'm gonna need you to come in on Saturday."
str.rotate_vowels
@flanger001
flanger001 / readme.md
Last active October 12, 2016 13:31
Ionic 1.3 and Typescript

How to get Ionic 1.3 working with Typescript 2.0

This is a huge pain in the butt process. Work in progress.

Starting from a new Ionic app

  • ionic start myapp tabs
  • cd myapp
  • npm install --save-dev gulp-typescript browserify tsify typings typescript vinyl-buffer vinyl-source-stream (I'm not using all of these yet)
  • Edit gulpfile:

Keybase proof

I hereby claim:

  • I am flanger001 on github.
  • I am flanger001 (https://keybase.io/flanger001) on keybase.
  • I have a public key ASAk-Xk1h0680J2gvJ2DHU3IRBOCPrGN-ejC18u2JN19wgo

To claim this, I am signing this object: