Skip to content

Instantly share code, notes, and snippets.

View aenain's full-sized avatar
🎯
Focusing

Artur Hebda aenain

🎯
Focusing
View GitHub Profile
@aenain
aenain / export-wunderlist-indexeddb.js
Created June 18, 2019 20:16
Wunderlist to Dynalist export. Go to Wunderlist web interface, backup data (JSON file), folders, list positions (from IndexedDB), use this script and import the output into Dynalist. Heavily inspired by https://gist.github.com/bryanph/fcddf602d60d7c6ecdaf6584f2db55a5
var download = (filename, text) => {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
@aenain
aenain / analyze_modules.js
Last active December 7, 2022 21:26
JS script to visualize ES6 circular dependencies by producing a directed graph using dot notation.
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
@aenain
aenain / markdown_to_google_docs.rb
Created November 12, 2017 14:20
Convert a markdown file to a google doc file
# Usage: md2gd <PATH>.md
# Prerequisites:
# - gdrive cli
# - brew install gdrive
# - https://github.com/prasmussen/gdrive
# - authorization for the action is required
# - pandoc
# - brew install pandoc
# Known issues:
# - lists started with dashes in markdown end up being bulleted in a GDoc
@aenain
aenain / airtable.browser.js
Last active May 15, 2017 20:30
airtable.browser.js v0.5.0 that does not conflict with requirejs
requireNoConflict=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requireNoConflict=="function"&&requireNoConflict;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof requireNoConflict=="function"&&requireNoConflict;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
var Class = require('./class');
var AirtableError = Class.extend({
init: function(error, message, statusCode) {
this.error = error;
this.message = message;
this.statusCode = statusCode;
@aenain
aenain / GridHeightPlaceholder.java
Last active August 29, 2015 14:06
Fix etsy's staggered grid view when one column is higher than the other by more than grid view height. https://github.com/etsy/AndroidStaggeredGrid/issues/66
package no.bstcm.loyaltyapp.core.util;
import android.view.View;
import android.widget.AbsListView;
import com.etsy.android.grid.StaggeredGridView;
import no.bstcm.loyaltyapp.core.R;
/**
@aenain
aenain / sample_config.applescript
Created June 6, 2014 12:33
Proof of concept clone of tmuxinator functionality based on iTerm and AppleScript instead.
#!/usr/bin/osascript
set homePath to POSIX path of (path to home folder)
set iTermAutomation to load script POSIX file (homePath & "tmuxinator.scpt")
set projectDir to homePath & "Desktop/Ruby/growth-republic/iview-prototype"
tell iTermAutomation
openFullScreenTerminal()
activateSessionAndRunCommand("git fetch")
splitPaneHorizontally()
# Default PS1
default_ps1="\[\033[01;32m\]\u:\[\033[01;34m\]\w\[\033[00m\]"
# By default on Mac OSX ls's output is without colours.
alias ls='ls -G'
GOLIATH_PORT=9201
alias goliath="/etc/init.d/goliath_$GOLIATH_PORT"
alias redis='redis-server /usr/local/etc/redis.conf'
@aenain
aenain / commit_assets.sh
Created May 20, 2013 12:58
Put this file in Rails.root/script directory and make precompiling assets easy as possible again! Why? Removing appropriate files after precompiling assets seems inefficient.
#!/bin/bash
bundle exec rake assets:precompile
repository_root=$(git rev-parse --show-toplevel)
assets_directory="$repository_root/public/assets"
# 1. reads diff from the manifest.yml
# 2. takes only those lines which represent replaced assets
# 3. remove duplicates like: application.js => application/index.js
@aenain
aenain / .profile
Last active December 17, 2015 02:09
# Default PS1
default_ps1="\[\033[01;32m\]\u:\[\033[01;34m\]\w\[\033[00m\]"
# By default on Mac OSX ls's output is without colours.
alias ls='ls -G'
GOLIATH_PORT=9201
alias goliath="/etc/init.d/goliath_$GOLIATH_PORT"
alias redis='redis-server /usr/local/etc/redis.conf'
@aenain
aenain / equilibrium.rb
Last active December 15, 2015 22:28
Equilibrium.
# uses ruby 2.0
require 'test/unit'
module Symmetry
refine Array do
# Returns index of the first equilibrium if found or nil otherwise.
# Equilibrium is a symmetry point of an array - sum of elements before given element equals to a sum of the elements after it.
#
# Caution!