Skip to content

Instantly share code, notes, and snippets.

@mars
mars / create-react-app-on-heroku.sh
Created July 29, 2016 01:12
Create a React app & deploy to Heroku
## Global install of the app generator
npm install -g create-react-app
## Setup the app (first-time only)
create-react-app my-app
cd my-app
git init
# Create the Heroku app; requires free account at https://www.heroku.com/
heroku create -b https://github.com/heroku/heroku-buildpack-static.git
@DCAL12
DCAL12 / notebook_importing.py
Last active June 14, 2018 10:09 — forked from robclewley/notebook_importing.py
Module to import from ipython notebooks
"""
Module directly collated from
http://jupyter-notebook.readthedocs.io/en/latest/examples/Notebook/Importing%20Notebooks.html
"""
import io, os, sys, types
from IPython import get_ipython
from nbformat import read
from IPython.core.interactiveshell import InteractiveShell
def find_notebook(fullname, path=None):
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 3, 2024 15:54
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@axic
axic / stringaskey.sol
Last active July 10, 2019 00:10
How to use string as a key in a mapping in Solidity aka. how to store short strings cheape
//
// In Solidity, a mapping is like a hashmap and works with `string` like this:
// mapping (string => uint) a;
//
// However it doesn't support accessors where string is a key:
// mapping (string => uint) public a;
//
// "Internal compiler error: Accessors for mapping with dynamically-sized keys not yet implemented."
//
// An accessor returns uint when called as `a(string)`.
@db
db / bulletproof-npm-workflow.md
Last active January 20, 2017 03:15
Bulletproof NPM Workflow

Bulletproof NPM Workflow

Use the Bulletproof Git Workflow, and before code review:

pre-release package

Publish a pre-release version of the package:

@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active April 30, 2024 12:39
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@db
db / bulletproof-git-workflow.md
Last active January 11, 2024 06:05
bulletproof git workflow

Bulletproof Git Workflow

start working

git checkout master
git pull
git checkout -b feature/my-work
# edit your files
@lucasalmeida92
lucasalmeida92 / gulpfile.js
Last active August 9, 2018 06:45
Html5mode + ionic (server for development)
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var ngAnnotate = require('gulp-ng-annotate');
var sass = require('gulp-sass');
var jade = require('gulp-jade');
var minifyCss = require('gulp-minify-css');
var browserSync = require('browser-sync').create();
var uglify = require('gulp-uglify');
@DarrenN
DarrenN / get-npm-package-version
Last active April 17, 2024 16:57 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@coryhouse
coryhouse / gist:9e09fa659cf89e4eddef
Created August 6, 2015 13:09
Author data for "Building Applciations with React and Flux" on Pluralsight
module.exports = {
authors:
[
{
id: 'cory-house',
firstName: 'Cory',
lastName: 'House'
},
{
id: 'scott-allen',