This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
override fun showVariantSelectionDialog(pageType: String) { | |
// Direct data access | |
val product = productDetailViewModel.getProduct() | |
if (product == null) { | |
showProductDetailErrorDialog() | |
return | |
} | |
variantSelectionDialogProvider.provideVariantSelectionDialog( | |
content = getVariantSelectionContent(product, pageType), | |
anyVariantSelectedListener = { |
import kotlin.random.Random | |
import kotlin.random.nextInt | |
import kotlin.time.measureTime | |
fun main() { | |
val dataset = ExperimentData(listSize = 100, updateTimes = 5000000) | |
val experiments = mutableListOf<Experiment>() |
#!/bin/sh | |
CHANGES_EXIST="$(git status --porcelain | wc -l)" | |
if [ "$CHANGES_EXIST" -eq 0 ]; then | |
exit 0 | |
fi | |
git stash | |
git pull |
#!/bin/bash | |
OBSIDIAN_CONFIG="obsidian_sync.sh" | |
LOCATION=$( echo `pwd` | sed 's/ /\\ /g' ) | |
# Obsidian repo sync | |
crontab -l | |
echo "0 22 * * * cd "${LOCATION}" ; ./${OBSIDIAN_CONFIG} >> /tmp/cron.out 2>&1" | sort - | uniq - | crontab - | |
printf "\nCronjob is added.\n" |
def fetch(url): | |
import requests, gzip, os, hashlib, numpy, sys | |
fp = os.path.join("/tmp", hashlib.md5(url.encode('utf-8')).hexdigest()) | |
if os.path.isfile(fp): | |
with open(fp, "rb") as f: | |
data = f.read() | |
else: | |
with open(fp, "wb") as f: | |
data = requests.get(url).content |
import os | |
from contextlib import contextmanager | |
import json | |
def listdir_nohidden(path: str) -> None: | |
return sorted([f for f in os.listdir(path) if "." not in f], key=str.lower) | |
@contextmanager | |
def working_dir(directory: str) -> None: |
def quicksort(arr): | |
p = 0 | |
r = len(arr) - 1 | |
solve_recursive(arr,p,r) | |
def solve_recursive(arr,p,r): | |
if(p<r): | |
q = partition(arr,p,r) |