Skip to content

Instantly share code, notes, and snippets.

@da1nerd
da1nerd / keybase.md
Last active September 1, 2020 15:58

Keybase proof

I hereby claim:

  • I am da1nerd on github.
  • I am da1nerd (https://keybase.io/da1nerd) on keybase.
  • I have a public key ASAfZvmuCdaFdeZ_jRF8Rlqp5qU_4MHLZsOIZ3bVcLsE8go

To claim this, I am signing this object:

@da1nerd
da1nerd / gitme
Created July 9, 2020 16:24
A utility to quickly clone github repositories.
#!/usr/bin/env bash
BASE_DIR=~/git
set -e
echo "this tool will clone a Github repo into your ~/git folder"
if [[ $# -lt 1 ]]
then
@da1nerd
da1nerd / electronite-tools.sh
Last active April 24, 2020 05:05
Tools to build electronite
#!/bin/bash
set -e
ELECTRONITE_REPO="https://github.com/unfoldingWord-dev/electronite"
COMMAND=$1
# Configure environment variables and paths
export GIT_CACHE_PATH="${HOME}/.git_cache"
mkdir -p "${GIT_CACHE_PATH}"
export SCCACHE_BUCKET="electronjs-sccache"
@da1nerd
da1nerd / electronite-tools.bat
Last active April 30, 2021 03:42
Tool for building electronite
echo off
set ELECTRONITE_REPO="https://github.com/unfoldingWord-dev/electronite"
set working_dir=%cd%
set GIT_CACHE_PATH=%userprofile%\.git_cache
set SCCACHE_BUCKET=electronjs-sccache
set SCCACHE_TWO_TIER=true
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
rem TODO: configure environment variables.
@da1nerd
da1nerd / electron-tools.sh
Last active July 27, 2019 04:21
Tools for building and testing Electron
#!/bin/bash
ELECTRON_REPO="https://github.com/electron/electron"
BRANCH=""
VARIANT=Release
APP_NAME=test-app
# git cache
export GIT_CACHE_PATH="${HOME}/.git_cache"
mkdir -p "${GIT_CACHE_PATH}"
@da1nerd
da1nerd / ObjectReader.java
Last active February 23, 2017 17:54
A utility class for reading Java Maps without going insane.
/**
* A utility for reading nested objects without pulling your hair out.
*
* Supported objects: List, Map, JSONObject, JSONArray
*
*/
public class ObjectReader implements Iterable<ObjectReader> {
private final Object map;
/**
@da1nerd
da1nerd / ts-schema
Last active October 22, 2015 01:39
-- ---
-- Table 'translation_note'
--
-- ---
DROP TABLE IF EXISTS `translation_note`;
CREATE TABLE `translation_note` (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`slug` TEXT NOT NULL,
@da1nerd
da1nerd / MainActivity.java
Last active August 29, 2015 14:27
Sample code for checking if backups are available to import
File primaryBackupDir = new File(AppContext.getPublicDirectory(), "backups/");
String[] dirNames = primaryBackupDir.list();
if(dirNames != null && dirNames.length > 0) {
// TODO: perform backup restore
}
@da1nerd
da1nerd / designer.html
Last active August 29, 2015 14:12
designer
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;