Skip to content

Instantly share code, notes, and snippets.

@divanvisagie
divanvisagie / system.js
Last active December 10, 2015 05:48
The system function attempts to bring the C system() function to node.js with extended functionality. system() executes a command and fires an event when done that will return the command output. system has 2 events: 'data' - returns the output data of the command 'exit' - returns command exit code dependancies npm install colors Examples of the…
/* License MIT */
var spawn = require( 'child_process' ).spawn,
colors = require( 'colors' );
/*
Executes a command and fires event when done that
will return the command output
*/
function system( cmd ){
@mrryanjohnston
mrryanjohnston / Dockerfile
Created March 9, 2014 01:38
Golang development environment using Docker
FROM ubuntu:13.10
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install golang
RUN mkdir /go
RUN export GOPATH=/go
ENV GOPATH /go
RUN export PATH=$PATH:$GOPATH/bin
@itoonx
itoonx / improved-lnd-bitcoind-install.md
Created January 28, 2018 07:09 — forked from bretton/improved-lnd-bitcoind-install.md
updated & improved guide to installing LND, Bitcoind, on Ubuntu 16.04 Server on testnet

Intro

the following guide is an updated install process based on the following, which needs some improvement still

This guide here is specific to getting lnd and bitcoind running on ubuntu 16.04 LTS for testnet.

It does not address mainnet, or using btcd, or neutrino.

btcd guide here

@scoutman57
scoutman57 / .gitconfig
Created April 24, 2014 20:28
Use PHPStorm as your git diff tool
# Run `git difftool <directory/file>...` or `git mergetool <directory/file>...`
[merge]
tool = phpstorm
[diff]
tool = phpstorm
[difftool]
prompt = false
[difftool "phpstorm"]
cmd = /Applications/PhpStorm\\ EAP.app/Contents/MacOS/phpstorm diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")
trustExitCode = true
version: '3.1'
services:
reverse-proxy:
image: traefik # The official Traefik docker image
command: --api --docker # Enables the web UI and tells Traefik to listen to docker
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
@markblundeberg
markblundeberg / atomic-size-attack.md
Created February 16, 2018 05:14
Advisory: secret size attack on cross-chain hash lock smart contracts

Advisory: secret size attack on cross-chain hash lock smart contracts

Dr. Mark B Lundeberg, 2018 Feb 15 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

This security advisory notes a vulnerability in the common construction of cross-chain smart contracts (contracts between distinct cryptocurrencies) through hash locking. I focus on the primary use case in [atomic

@brunogaspar
brunogaspar / difference.md
Last active October 13, 2020 15:52
[PHP] Percentage Calculation Helpers

Calculate Difference

if (! function_exists('calculatePercentage')) {
    /**
     * Calculates the percentage between the given values.
     *
     * @param int|string $previous
     * @param int|string $current
     *
@brettscott
brettscott / Link.tsx
Created November 14, 2019 13:44
React Link component in Nextjs (v9) with Next Link, Next Router, Material-UI's MuiLink and TypeScript
@oncomouse
oncomouse / StyledTransition.js
Last active April 15, 2021 05:24
Using CSSTransitionGroup with Emotion.js
import React from 'react';
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import { CSSTransition } from 'react-transition-group';
const has = (key, obj) => Object.prototype.hasOwnProperty.call(obj, key);
const keyframes = [
'appear',
'enter',
@benmccallum
benmccallum / _Instructions.md
Last active July 25, 2021 03:35
nuxtjs, bootstrap-vue with custom bootstrap build

Important! This guide is out of date (circa 2017) and should no longer be used. For the latest advice, please refer to the BootstrapVue docs and their Nuxt.js module. https://bootstrap-vue.org/docs#nuxt-js

General setup:

  1. Install bootstrap as a dev dependency, and its dependencies (node-sass and sass-loader) npm install --save-dev bootstrap@4.0.0-beta.2 node-sass sass-loader