Skip to content

Instantly share code, notes, and snippets.

View thirdreplicator's full-sized avatar

David B thirdreplicator

View GitHub Profile
more .babelrc
{
"presets": [ "@babel/preset-env" ]
}
@thirdreplicator
thirdreplicator / lib_crypt.js
Created June 13, 2018 02:49
DIY file encryption
#!/opt/node/bin/node
// ~/bin/lib_crypt.js
const fs = require('fs')
const spawn = require('child_process').spawn
const SUCCESS = 0
function in_out_file(direction, base_file_name) {
const file_arr = [base_file_name + '.enc', base_file_name + '.txt']
@thirdreplicator
thirdreplicator / extra missing instructions when installing react-native-fbsdk
Created November 9, 2017 18:28
If you get this error: ~/$REACT_NATIVE_PROJECT_ROOT_DIR/android/app/build/intermediates/res/merged/debug/values-v24/values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored', then make the following changes to ./android/app/build.gradle
# ./android/app/build.gradle
# Extra missing instructions
# 1. Change compileSdkVersion to 25
# 2. and buildToolsVersion to 25.0.3.
# 3. and targetSdkVersion to 25
android {
compileSdkVersion 25
@thirdreplicator
thirdreplicator / advanced.config
Created March 23, 2017 04:48
An example Riak advanced.config file adding the delete_mode parameter set to "immediate". On Ubuntu, this file is located here: /etc/riak/advanced.config
%% Config file used to set advanced configuration options
[
{riak_kv, [
{delete_mode, immediate}
]},
{lager,
[
{extra_sinks,
[
@thirdreplicator
thirdreplicator / gist:70cf4e1dc232a5c8fc49
Created July 16, 2015 06:24
when trying to run autoconf on ubuntu
$ sudo aptitude install autoconf autoconf-archive automake libtool
$ libtoolize --force
$ aclocal
$ autoheader
$ automake --force-missing --add-missing
$ autoconf
$ ./configure
@thirdreplicator
thirdreplicator / gist:cdf1a2cb48024648b3d6
Created April 11, 2015 08:58
How to debug a makefile
# Add this line to your Makefile.
print-%: ; @echo $*=$($*)
# if you want to know the name of the value of SOURCE_FILES,
make print-SOURCE_FILES
@thirdreplicator
thirdreplicator / gist:0167625df3ac4af67a58
Created November 4, 2014 03:46
try-catch macro clojure
(defn add-line-breaks [string-seq]
(->> string-seq
(interpose "\n")
clojure.string/join))
(defmacro record-error [& body]
`(try ~@body (catch Throwable t#
(add-line-breaks (map str (.getStackTrace t#))))))
@thirdreplicator
thirdreplicator / .vimrc
Created April 19, 2014 21:53
my .vimrc file
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|target'
call pathogen#infect()
call pathogen#helptags()
set nocompatible
filetype on
filetype plugin on
syntax on
@thirdreplicator
thirdreplicator / README
Created April 19, 2014 21:15
to switch working on different projects
# Usage example
~/Projects/foo> wol
foo
bar
~/Projects/foo> wop bar
source ~/.bashrc
~/Projects/bar>
@thirdreplicator
thirdreplicator / put_this_in_your_bashrc.sh
Created April 12, 2014 07:53
Bash script to fuzzy find files and copy file name to clip board if there is only 1 result.
# Usage example:
# f entry factory tests
# vi <CTRL-V>
#
# You can change the filtered directories and file types in the first line of the function.
#
# Find groovy files and copy the unique result to the clip board.
function f() {
files=`find grails-app src test -name "*.groovy" -type f`
for pat in "$@"