Skip to content

Instantly share code, notes, and snippets.

git remote prune origin - to remove a deleted remote branch.
git rebase -i - interactive rebase with options to pick, squash, discard and reorder commits.
git update-index --assume-unchanged
Undoing a merge:
$ git pull $REMOTE $BRANCH
# uh oh, that wasn't right
$ git reset --hard ORIG_HEAD
# all is right with the world
@stesie
stesie / index.html
Created April 1, 2016 22:28
AWS IoT-based serverless JS-Webapp Pub/Sub demo
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>AWS IoT Pub/Sub Demo</title>
</head>
<body>
<h1>AWS IoT Pub/Sub Demo</h1>
<form>
<button type="button" id="connect">connect!</button>
@willm
willm / dynamo cheet sheet.sh
Last active April 12, 2018 23:45
dynamo cheat sheet
#count of items
aws dynamodb scan --table-name baskets --select COUNT
#item by key
aws dynamodb get-item --table-name baskets --key '{"Id":{"S": "195eaf9c-50e6-4524-81e0-22403e46b6df"}}'
@ArturoNereu
ArturoNereu / BareBoneShader.shader
Created October 11, 2016 22:32
The basic shader for Unity. A template to make more advanced ones.
Shader "CustomShaders/BareBoneShader"
{
//Properties
Properties
{
_Color("Main Color", Color) = (1,1,1,1)
}
//Subshaders
SubShader
@thehig
thehig / reactResearch.md
Created December 4, 2016 11:36
js: React Research
@vlucas
vlucas / encryption.js
Last active July 23, 2024 01:24
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@drosenstark
drosenstark / LockingWithSwiftAndGCD.swift
Created March 20, 2017 20:58
Locking Demo with GCD and Swift (Playground)
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
// CHANGE THIS TO TRUE FOR the lock queue to be used
let useLocks = false
var counter : Int = 0
@arranbartish
arranbartish / package.json
Created March 30, 2017 16:50
Serverless package.json
{
"name": "serverless-typescript-demo",
"version": "1.0.0",
"description": "Basic demo mixing Serverless and TypeScript",
"main": "handler.ts",
"scripts": {
"lint": "tslint *.ts",
"test:local": "mocha --compilers ts:ts-node/register,tsx:ts-node/register tests.ts",
"test:remote": ". ./helpers/endpoint.sh; mocha remote/tests.js",
"deploy:cicd": "mkdir .build; serverless deploy --stage cicd | tee .build/deploy.out"
@Anveio
Anveio / tsconfig.json
Created July 29, 2017 16:49
tsconfig for typescript-lambda-example
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": [ "es6", "dom" ],
"moduleResolution": "node",
"rootDir": "./",
"sourceMap": true,
"allowJs": true,
"noImplicitAny": true,