Skip to content

Instantly share code, notes, and snippets.

View Janaka-Steph's full-sized avatar
🎯
Focusing

Janaka-Steph

🎯
Focusing
View GitHub Profile
/*eslint-disable no-console, no-var */
import express from 'express'
import webpack from 'webpack'
import webpackDevMiddleware from 'webpack-dev-middleware'
import WebpackConfig from './webpack.config'
import path from 'path'
const app = express()
if (process.env.NODE_ENV === 'development') {
@VictorTaelin
VictorTaelin / ethereum_delayed_computations.md
Last active April 12, 2018 16:42
Make Ethereum massively scalable today with delayed computations

Make Ethereum massively scalable today with delayed computations

Suppose you're writing a contract which involves a huge amount of participants. As an example, think of an online, blockchain-based Trading-Card Game with tournaments. How would you program a playCard function? You might be thinking of something like this:

function playCard(uint player, uint card){
    ...
    else if (card == PROFESSOR_OAK){
        // shuffles the player's hand on his deck
 shuffleHand(player)
@matiu
matiu / gist:11182987
Created April 22, 2014 15:10
Creating and testing p2sh multisig bitcoin transactions
$bitcoind getinfo
{
"version" : 99900,
"protocolversion" : 70002,
"walletversion" : 60000,
"balance" : 15.74900000,
"blocks" : 226032,
"timeoffset" : -4,
"connections" : 9,
@dwallraff
dwallraff / keybase_backup.sh
Created July 12, 2017 21:32
Encrypted tarball backup for keybase private folder backup
## Encrypt
tar cz * | openssl enc -e -aes-256-cbc -salt -out keybase_`date "+%Y%m%d"`.tar.gz.enc
## Decrypt
openssl enc -d -aes-256-cbc -salt -in <ENCRYPTED_KEYBASE_TARBALL> | tar xvz
## Crontab
10 12 * * * cd /Users/dwallraff/backups && tar cz /keybase/private/dwallraff | openssl enc -e -aes-256-cbc -salt -k $PASSWORD -out keybase_`date "+%Y%m%d"`.tar.gz.enc >/dev/null 2>&1
@asachs01
asachs01 / odroidSetup.yml
Created August 23, 2015 20:54
An Ansible Playbook to Setup My Odroid Herd Easily
---
- name: Initial Odroid Setup
hosts: odroids-local
user: root
vars:
- root_password: 'HASHED ROOT PASSWORD HERE'
- <YOUR USER>_password: 'USER PASSSWORD HERE'
tasks:
- name: Change root password

Document

Toggle Me

This content is revealed when the "Toggle Me" label is clicked.

@khaledosman
khaledosman / Create a PWA in React.js
Last active March 10, 2020 18:24
create-react-app PWA example with epilog to update autogenerated service worker to skipInstall and show notifications using material-ui
We couldn’t find that file to show.
@lorefnon
lorefnon / package.json
Created August 18, 2018 19:44
Integrating next.js, Apollo Server and Koa
{
"main": "server/index.js",
"scripts": {
"dev": "nodemon --watch server server/index.js",
"build": "next build",
"start": "NODE_ENV=production node server/index.js"
},
"dependencies": {
"apollo-boost": "^0.1.13",
"apollo-server": "^2.0.4",
@hacknlove
hacknlove / useStorage.js
Created July 2, 2019 11:51
Custom react hook useStorage for browser extension developers
import browser from 'webextension-polyfill'
import { useState, useEffect } from 'react'
function isDiferent (a, b) {
if (typeof a !== typeof b) {
return true
}
if (Array.isArray(a)) {
return arrayIsDifferent(a, b)
}
@frozeman
frozeman / mistweb3.js
Last active July 22, 2021 01:00
Mist web3 loading proposal
/*
Basically "web3" comes from Mist,
but "Web3" CAN come from the dapp.
A Dapp has 3 ways to use web3.
2. and 3. would work when in Mist and outside.
*/
// 1. simply use, web3 comes already defined