Skip to content

Instantly share code, notes, and snippets.

View chrisbraddock's full-sized avatar

Chris Braddock chrisbraddock

View GitHub Profile
@chrisbraddock
chrisbraddock / pip_install
Created May 5, 2024 18:08 — forked from chrisRedwine/pip_install
Pip install a specific github repo tag or branch
# From https://coderwall.com/p/-wbo5q/pip-install-a-specific-github-repo-tag-or-branch
pip install -e git://github.com/{ username }/{ reponame }.git@{ tag name }#egg={ desired egg name }
@chrisbraddock
chrisbraddock / anaconda-clean-base.sh
Created May 2, 2024 18:04
Reset Anaconda / Miniconda Base Environment
# https://stackoverflow.com/a/77768997/227260
CONDA_DIR="$HOME/anaconda3"
CONDA_DIR_BAK="${CONDA_DIR}_bak"
# Miniconda: https://docs.anaconda.com/free/miniconda/miniconda-other-installer-links/
# Anaconda: https://repo.anaconda.com/archive/
CONDA_INSTALL_SHELL="https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh"
# Check if backup directory exists and move if it does not
@chrisbraddock
chrisbraddock / firebase-circleci.yml
Last active July 4, 2019 14:40
Firebase, CircleCi - lint, test, build, deploy; triggers on dev/master branches with develop/production contexts, respectively
version: 2.1
jobs:
build-deploy: &build-deploy
docker:
- image: circleci/node:10.15.1-browsers
working_directory: ~/repo
steps:
- checkout
@chrisbraddock
chrisbraddock / gist:8ab64f6862941ec131a1f800afeaa980
Last active March 11, 2020 17:39
Use the config below to plop Vuex modules. Plop - https://github.com/amwmedia/plop
$ npm i -g plop
$ npm i --save-dev plop
// install the plopfile below
// install the template below
$ plop store:module
// repo root/plopfile.js:
module.exports =
@chrisbraddock
chrisbraddock / gist-editor-height-fix.js
Last active October 31, 2016 11:48
Fix GitHub Gist Editor Height - DevTools Code Snippet
document.getElementsByClassName('CodeMirror')[0].style.height = '100%';
public class Value {
private boolean modified = false;
private int val;
public Value(initialVal) {
val = initialVal;
}
public void setVal(int newVal) {
val = newVal;
// server
var express = require('express');
var request = require('request');
var apiServerHost = 'http://api.openweathermap.org';
var app = express();
app.use(function(req, res) {
var url = apiServerHost + req.url;
console.log('serving:', url);
req.pipe(request(url)).pipe(res);
@chrisbraddock
chrisbraddock / q-finally.js
Last active August 29, 2015 14:21
$q finally
var $q = angular.element(document).injector().get('$q');
function fn1() {
return $q.when('foo');
}
function fn2(arg) {
console.log('fn2', arguments);
return $q.when(arg);
}
@chrisbraddock
chrisbraddock / keybase.md
Created November 20, 2014 20:20
Keybase proof

Keybase proof

I hereby claim:

  • I am chrisbraddock on github.
  • I am chrisbraddock (https://keybase.io/chrisbraddock) on keybase.
  • I have a public key whose fingerprint is F484 5D5C 1500 A77F 097A 2AA7 656A 04EC E98C DC42

To claim this, I am signing this object:

@chrisbraddock
chrisbraddock / large-xfer.sh
Last active October 31, 2016 11:58
transfer large amount of files - e.g. a large multi-terabyte directory with many subdirectories between physical drives
# -f If the destination file cannot be opened, remove it and create a new file, without
# prompting for confirmation regardless of its permissions. (The -f option overrides
# any previous -n option.)
# -p Cause cp to preserve the following attributes of each source file in the copy: mod-
# ification time, access time, file flags, file mode, user ID, and group ID, as
# allowed by permissions. Access Control Lists (ACLs) and Extended Attributes (EAs),
# including resource forks, will also be preserved.
#
# If the user ID and group ID cannot be preserved, no error message is displayed and
# the exit value is not altered.