I try to learn every year a new programming language, just to see how things work in different environments. I have an advanced web development background and try to find my way into iOS development. Each Lesson I take or library I used will be part of this gist, maybe this will result also in a blog post :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { get } from 'lodash' | |
export const connectToWorker = Worker => { | |
const worker = new Worker() | |
let registered = false | |
return (store, action) => { | |
const state = store.getState() | |
if (!registered) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm -v $(pwd):/test ubuntu:latest bash -c "dd if=/dev/zero of=/test/testfile bs=1G count=1 && rm test/testfile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ocr.sh for Mac OSX 10.11 | |
# works in memory (~/.ocr-TIMESTAMP) | |
# needs pdftk, pdftoppm, tesseract-ocr | |
# Port from multithreaded OCR with tesseract 3.03/3.04 (Michael Luthardt <[email protected]> 2016, https://dr-luthardt.de/linux.htm?tip=pdfx) | |
# PREREQUISITES (requires homebrew) | |
# 1 - tesseract: brew install tesseract --with-all-languages (all languages will take up to 1.2gb space, see https://github.com/tesseract-ocr/tesseract/wiki to install ony selective) | |
# 2 - pdftk: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg | |
# 3 - pdftotext, pdftoppm: brew install poppler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat << "EOF" | |
______ ____ ___ __ | |
/\ _ \ __ /\ _`\ /\_ \ /\ \ | |
\ \ \L\ \/\_\ _ __\ \ \L\ \//\ \ __ __ __\ \ \ | |
\ \ __ \/\ \/\`'__\ \ ,__/ \ \ \ /'__`\ /\ \/\ \\ \ \ | |
\ \ \/\ \ \ \ \ \/ \ \ \/ \_\ \_/\ \L\.\_\ \ \_\ \\ \_\ | |
\ \_\ \_\ \_\ \_\ \ \_\ /\____\ \__/.\_\\/`____ \\/\_\ | |
\/_/\/_/\/_/\/_/ \/_/ \/____/\/__/\/_/ `/___/> \\/_/ | |
/\___/ | |
\/__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
unzip -qq instantclient-sqlplus-macos.x64-11.2.0.4.0.zip | |
unzip -qq instantclient-basic-macos.x64-11.2.0.4.0.zip | |
cd instantclient_11_2 | |
mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/bin | |
mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/lib | |
mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/jdbc/lib | |
mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/rdbms/jlib | |
mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/sqlplus/admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Convert Array like Object to Array | |
* Source: http://xahlee.info/js/js_convert_array-like.html | |
*/ | |
Object.prototype.toArray = function () { | |
return Array.prototype.slice.call(this); | |
} | |
// {0:"a", 1:"b",2:"c", length:3}.toArray() => ['a', 'b', 'c'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Minimal jQuery replacement | |
*/ | |
(function () { | |
'use strict'; | |
var find = function (element) { | |
return function (query) { | |
var results = element.querySelectorAll(query), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
project=${PWD##*/} | |
git clone https://github.com/alexander-heimbuch/webdev-boilerplate.git . | |
rm -rf .git && \ | |
sed -i '' "s/project-name/$project/g" package.json && \ | |
npm i |
NewerOlder