Skip to content

Instantly share code, notes, and snippets.

View mdornseif's full-sized avatar

Maximillian Dornseif mdornseif

View GitHub Profile
@Yimiprod
Yimiprod / difference.js
Last active April 5, 2024 13:17
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@simenbrekken
simenbrekken / KeyboardShortcutsMixin.js
Created August 31, 2014 08:15
React Keyboard Shortcuts Mixin
'use strict';
var KEYS = {
enter: 13,
left: 37,
right: 39,
escape: 27,
backspace: 8,
comma: 188,
shift: 16,
@duggi
duggi / Spot the Hijack
Last active February 15, 2018 14:56 — forked from tiffanygwilson/Spot the Hijack
Spot the Hijack
(* Script to record and tag spotify tracks, by Lloyd Moore *)
(* Modified by Tiffany G. Wilson to resolve audio splitting issues, automate starting/stopping, and add recording customization *)
(* Modified by github.com/duggi on 7/18/2014 -- replace slash with dashin new filename to prevent directory write errors *)
(* Snippets for controlling Spotify are from Johnny B on tumblr (http://johnnyb.tumblr.com/post/25716608379/spotify-offline-playlist) *)
(* The idea of using delayed tagging/filename updating is from a guest user on pastebin (http://pastebin.com/rHqY0qg9) *)
(* The only thing to change in the script is the output format; you must change the file extension and the recording format to match *)
(* Run this script once a song you want to record is queued (stopped at beginning) or playing *)
(* Running the script will initiate hijacking, recording and audio playback *)
(* To stop script, pause Spotify or wait for album/playlist to end*)
(* To set id3 tags, use application Kid3 (http://sourceforge.net/pr
(* Script to record and tag spotify tracks, by Lloyd Moore *)
(* Modified by Tiffany G. Wilson to resolve audio splitting issues, automate starting/stopping, and add recording customization *)
(* Snippets for controlling Spotify are from Johnny B on tumblr (http://johnnyb.tumblr.com/post/25716608379/spotify-offline-playlist) *)
(* The idea of using delayed tagging/filename updating is from a guest user on pastebin (http://pastebin.com/rHqY0qg9) *)
(* The only thing to change in the script is the output format; you must change the file extension and the recording format to match *)
(* Run this script once a song you want to record is queued (stopped at beginning) or playing *)
(* Running the script will initiate hijacking, recording and audio playback *)
(* To stop script, pause Spotify or wait for album/playlist to end*)
(* To set id3 tags, use application Kid3 (http://sourceforge.net/projects/kid3/) and copy '%{artist} - %{album} - %{track} - %{title}' from file name to Tag 2 *)
@crmne
crmne / Google Translate.scpt
Last active May 15, 2018 18:06
UPDATE: I made a LaunchBar 6 action that you can find here: http://static.paolino.me/GoogleTranslate.lbaction.zip. Make sure to enable Accessibility for LaunchBar, and "Allow Javascript from Apple Events" in Safari's Develop menu. -- Translates text using Google Translate in Safari. It gracefully handles large text, which is impossible with just…
on safari_is_ready(docNum, interval)
repeat
tell application "Safari"
try
do JavaScript "document.readyState" in document docNum
set readyState to result
set finishedLoading to (source of document docNum contains "</html>")
if finishedLoading and readyState is "Complete" then exit repeat
end try
end tell
@mdornseif
mdornseif / mt940toOFX.py
Last active July 14, 2020 13:42
Convert SWIFT MT940 data to OFX.
#!/usr/bin/env python
# encoding: utf-8
"""
mt940toOFX.py - Dieses Progrtamm liesst MT940 SWIFT Kontostände und konvertiert sie in OFX.
OFX wurde mit xero.com getestet.
Created by Maximillian Dornseif on 2010-06-05.
Copyright (c) 2010, 2013, 2014 HUDORA. All rights reserved.
"""
@urschrei
urschrei / extract_exif_gps.py
Last active October 26, 2023 20:11
Extract GPS data from jpg files, and write it to a CSV. Requires the PIL. Tested (haha) on Python 2.7.x
"""
Extract GPS coordinates and filename, output to CSV file
Run this file from the same directory the images are in
run using ./process_exif.py or python process_exif.py, or
%run process_exif.py from an IPython instance
Ensure you have PIL installed
refer to http://www.exiv2.org/tags.html for a full detailed tag listing
This is what the GPSInfo dict looks like for an iPhone 5 jpg:
@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@robcowie
robcowie / print_github.js
Created June 15, 2012 16:25
Github print styling bookmarlet
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg%3Ef.fn.jquery%7C%7Ch(f))%7Bc=a.createElement(%22script%22);c.type=%22text/javascript%22;c.src=%22http://ajax.googleapis.com/ajax/libs/jquery/%22+g+%22/jquery.min.js%22;c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd==%22loaded%22%7C%7Cd==%22complete%22))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,%221.3.2%22,function($,L)%7B$('%23header,%20.pagehead,%20.breadcrumb,%20.commit,%20.meta,%20%23footer,%20%23footer-push').remove();%20$('%23files,%20.file').css(%7B%22background%22:%22none%22,%20%22border%22:%22none%22%7D);%20$('link').removeAttr('media');%7D);