Skip to content

Instantly share code, notes, and snippets.

View KillerCodeMonkey's full-sized avatar
🐒

Bengt Weiße KillerCodeMonkey

🐒
View GitHub Profile
@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) {
### 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 / apollo-local-link.ts
Created March 13, 2019 15:00
To run apollo client against a local schema
@KillerCodeMonkey
KillerCodeMonkey / NFC+IONIC
Created June 16, 2015 11:31
NFC in angular ionic app
<!-- used with <gap:plugin name="com.chariotsolutions.nfc.plugin" /> -->
<!DOCTYPE html>
<html ng-app="app">
<head>
<title>nfc - Test</title>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Style -->
@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 / 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 / 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