Skip to content

Instantly share code, notes, and snippets.

View TravisMullen's full-sized avatar

Travis Mullen TravisMullen

View GitHub Profile
@TravisMullen
TravisMullen / rotateTextFilter.js
Last active June 8, 2017 18:19
Wrap each char of a string with indexed class
// es6
export function injector (_text, _classPrefix) {
let text
let inject = []
const prefix = _classPrefix || 'char-'
if (typeof (_text) !== 'string') {
text = _text.toString()
} else {
text = _text
}
@TravisMullen
TravisMullen / advanceBlock.js
Created June 28, 2017 15:17
Advance testrpc block during tests
// `evm_` ONLY works in the testrpc `development` env
// `evm_mine` is not a standard web3/eth call
function advanceBlock() {
return new Promise(resolve => {
web3.currentProvider.sendAsync({
method: "evm_mine",
jsonrpc: "2.0",
id: new Date().getTime()
}, function (error, result) {
if (error) {
<!-- <parallax>
<img class="color" src="static/img/rainbow_main_45q.jpg">
</parallax> -->
<template>
<div :class="[sectionClass]" ref="container">
<!-- foreground-content -->
<div
class="foreground-content"
ref="foreground">
<slot name="foreground"></slot>
<template lang="pug">
a.button.bookmark-action(
@click.prevent='bookmarkAction',
:href='href',
:rel='rel',
:title='title'
)
.svg-icon.small.fill-cream(
v-once='',
v-html='icon'
@TravisMullen
TravisMullen / greatestComDenom.js
Created August 1, 2017 21:46
greatest common denom
export function getGCD (a, b) {
for (let c; b; a = b, b = c) {
c = a % b
}
return a
}
<template lang="pug">
a.button.icon-link(
target='_blank',
:href='route',
:title='title'
)
.svg-icon.small.fill-cream(
v-once='',
v-html='icon'
)
@TravisMullen
TravisMullen / BookmarkIcon.vue
Created August 5, 2017 17:00
Bookmark with inline SVG
<template lang="pug">
a.button.bookmark(
@click.prevent='bookmarkAction',
:href='href',
:rel='rel',
:title='title'
)
.svg-icon(
v-once='',
v-html='icon'
@TravisMullen
TravisMullen / reset
Created August 11, 2017 01:31
PRESERVE the files before the last commit
# undo commit and REVERT the files to the last HEAD
git reset --hard HEAD~1
# undo commit but PRESERVE the files before the last commit
git reset HEAD~1
@TravisMullen
TravisMullen / pivx.conf
Last active May 5, 2018 14:47
pivx conf
##
## pivx.conf configuration file. Lines beginning with # are comments.
##
enablezeromint=0
# Network-related settings:
# Run on the test network instead of the real pivx network.
#testnet=0
#!/bin/bash
ifconfig en0 inet | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" | sed -n 1p