Skip to content

Instantly share code, notes, and snippets.

View slimeygecko's full-sized avatar

Mike Woodward slimeygecko

  • Minneapolis, MN
View GitHub Profile
@gerv
gerv / tomboy_to_simplenote.py
Last active June 15, 2017 05:48
Hacky script to use desktop scripting to move notes from Tomboy to Simplenote
# This script works with autokey - https://github.com/autokey/autokey/
# Define a hotkey (e.g. F12), make sure the Tomboy "Search All Notes" window and the Simplenote window are open
# Then just keep hitting F12. One note will be imported each time.
# Note: no formatting is preserved :-(
def activate_tomboy():
window.activate("Search All Notes")
time.sleep(0.25)
def open_next_tomboy_note():
keyboard.send_key("<down>")
@gaearon
gaearon / createAsyncPage.jsx
Last active April 25, 2023 09:06
Webpack's async code splitting with React Router
'use strict';
var React = require('react');
function createAsyncHandler(getHandlerAsync, displayName) {
var Handler = null;
return React.createClass({
displayName: displayName,
@niksumeiko
niksumeiko / git.migrate
Last active July 19, 2024 21:32
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
(function() {
// NOTE: I have intentionally avoided the use of jQuery in
// the next two functions so as not to obscure any details.
// Updates the DOM in such a way that layout is constantly
// computed and thrown away.
var UpdateThrash = function(data) {
// Get all the labels
var spans = document.querySelectorAll('.item .lab');
@rozmiarek
rozmiarek / ajaxfileupload.js
Created April 26, 2012 20:41 — forked from HenrikJoreteg/ajaxfileupload.js
AJAX file uploading using jQuery and XMLHttpRequest 2.0 and adding listener for progress updates
// grab your file object from a file input
$('#fileInput').change(function () {
sendFile(this.files[0]);
});
// can also be from a drag-from-desktop drop
$('dropZone')[0].ondrop = function (e) {
e.preventDefault();
sendFile(e.dataTransfer.files[0]);
};