Skip to content

Instantly share code, notes, and snippets.

View KillerCodeMonkey's full-sized avatar
🐒

Bengt Weiße KillerCodeMonkey

🐒
View GitHub Profile
### Keybase proof
I hereby claim:
* I am killercodemonkey on github.
* I am bengtler (https://keybase.io/bengtler) on keybase.
* I have a public key ASAseeSfbCZ1S1Lopmz-jlW7pQiWwsgPA08iTdxvNrbNGwo
To claim this, I am signing this object:
@KillerCodeMonkey
KillerCodeMonkey / jpeg-exif-image-orientation-js
Created June 28, 2019 05:41
JS script to detect jpeg orientation from exif data using filereader api
var orientation = function (file, callback) {
var fileReader = new FileReader();
fileReader.onloadend = function () {
var base64img = "data:" + file.type + ";base64," + _arrayBufferToBase64(fileReader.result);
var scanner = new DataView(fileReader.result);
var idx = 0;
var value = 1; // Non-rotated is the default
if (fileReader.result.length < 2 || scanner.getUint16(idx) != 0xFFD8) {
// Not a JPEG
if (callback) {
@KillerCodeMonkey
KillerCodeMonkey / apollo-local-link.ts
Created March 13, 2019 15:00
To run apollo client against a local schema
@KillerCodeMonkey
KillerCodeMonkey / gitRenameBranch.sh
Created February 22, 2016 07:14
git rename branch
git push origin origin/OLD_BRANCH:refs/heads/NEW_BRANCH && git push origin :OLD_BRANCH
@KillerCodeMonkey
KillerCodeMonkey / gitTags.sh
Created February 22, 2016 07:13
working with tags
// create new tag
git tags -a <tagName>
git push --tags
// move tag to another commit
git tag -f -a <tagname>
git push -f --tags
// list tags
git tag -l
@KillerCodeMonkey
KillerCodeMonkey / gitDeployBranch.sh
Created February 22, 2016 07:12
git deploy new branch
// get new release
git fetch --tags
git checkout -b <tagname> tags/<tagname>
// update existing tag
// switch branch before
git branch -d <tagname>
git fetch --tags
git checkout -b <tagname> tags/<tagname>
@KillerCodeMonkey
KillerCodeMonkey / gitHistory.sh
Created February 22, 2016 07:11
generate GitHistory
git log 1.1.1...1.1.2 --pretty=format:'* %s * view commit %H' | grep -v Merge
@KillerCodeMonkey
KillerCodeMonkey / sublime.conf
Last active April 1, 2016 19:47
Sublime Text 3 - Plugins & Config
Plugins:
========
AdvancedNewFile
AngularJS
Babel
BracketHighlighter
DocBlockr
Emmet
Git
GitGutter
@KillerCodeMonkey
KillerCodeMonkey / gitHistory.sh
Created February 8, 2016 07:24
Get GitHistory
git log 1.1.1...1.1.2 --pretty=format:'* %s * view commit %H' | grep -v Merge
@KillerCodeMonkey
KillerCodeMonkey / elementSize.js
Created January 7, 2016 08:06
Angular directive to get size of an element
angular.module('app', ['ionic']).directive('elementSize', [
'$timeout',
function ($timeout) {
return {
restrict: 'A',
link: function (scope, element, attrs) {
element.ready(function () {
var height,
width;
$timeout(function () {