Skip to content

Instantly share code, notes, and snippets.

View thestephenmarshall's full-sized avatar

Stephen Marshall thestephenmarshall

View GitHub Profile
@thestephenmarshall
thestephenmarshall / 0_reuse_code.js
Created June 5, 2014 20:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
.post-outer {
width: 250px;
float: left;
}
#blog-pager {
position: absolute;
top: -40px;
}
<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>-->
<script src="https://www.dropbox.com/s/mx9ty7s4z5txhbm/isotope.pkgd.min.js?dl=1"></script>
<script>
setTimeout(function(){
$('#main .date-outer .date-posts').each(function(i, dp){
var $container = $(this).isotope({
itemSelector: '.post-outer',
layoutMode: 'masonry',
masonry: {
columnWidth: '.post-outer'
@thestephenmarshall
thestephenmarshall / dockeraliases.md
Last active August 29, 2015 14:27
Docker Aliases
alias dockme='bash -c "export PATH='"'"'/Applications/Kitematic (Beta).app/Contents/Resources/resources:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'"'"' && clear && DOCKER_HOST=tcp://192.168.99.100:2376 DOCKER_CERT_PATH=$HOME/.docker/machine/machines/dev DOCKER_TLS_VERIFY=1 /bin/zsh"'
alias dcup='docker-compose up'
alias dbld='docker-compose build'
alias dps='docker ps'
alias dkill='docker rm $(docker stop $(docker ps -aq))'
@thestephenmarshall
thestephenmarshall / waitloop.js
Last active October 29, 2015 15:58
Wait for loop to complete using async/await
async () => {
let done = () => {
return new Promise((resolve, reject) => {
async () => {
let completed = 0;
const list = [0,1,2];
for(let x in list) {
let tbd = () => {
return new Promise((resolve, reject) => {
setTimeout(() => {
@thestephenmarshall
thestephenmarshall / coffee.js
Last active April 18, 2016 19:02
Rancillio coffee maker script!
class Rancilio {
turnOn() {
console.log('Turning the machine on...');
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log('Machine is on!');
resolve();
}, 1000);
});
}
@thestephenmarshall
thestephenmarshall / fibonacci.js
Last active April 12, 2017 19:24
ES6 Fibonacci Sequence
// https://es6console.com/j1fcx8bv
const fibonacci = (startNum=0, prevNum, stopAt=88) => {
let newNum;
if(typeof(prevNum) === 'undefined') {
newNum = startNum || 1;
console.log('start fibonacci...');
console.log(startNum);
fibonacci(startNum, newNum, stopAt);
return;
@thestephenmarshall
thestephenmarshall / structure.sql.diff
Created June 16, 2017 15:43
Structure.sql - diff master
diff --git a/components/nitro_component_transition/spec/dummy/db/structure.sql b/components/nitro_component_transition/spec/dummy/db/structure.sql
index 7e6c8478f5..3cbf5374f0 100644
--- a/components/nitro_component_transition/spec/dummy/db/structure.sql
+++ b/components/nitro_component_transition/spec/dummy/db/structure.sql
@@ -5104,7 +5104,6 @@ CREATE TABLE `nitro_component_transition_pto_hours` (
KEY `index_nitro_component_transition_pto_hours_on_user_id` (`user_id`),
KEY `index_nitro_component_transition_pto_hours_on_pay_period_id` (`pay_period_id`),
KEY `index_nitro_component_transition_pto_hours_on_created_by_id` (`created_by_id`)
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
@thestephenmarshall
thestephenmarshall / autoload.sh
Created February 9, 2018 17:35
Autoload nvmrc
# NVM
autoload -U add-zsh-hook
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use
fi
}
add-zsh-hook chpwd load-nvmrc

Keybase proof

I hereby claim:

  • I am thatjsguy on github.
  • I am themarshall (https://keybase.io/themarshall) on keybase.
  • I have a public key ASAt10K6jzS4ZlyIAYau7D0iRNvVMfYyHYuidFN8AAYCOQo

To claim this, I am signing this object: