Skip to content

Instantly share code, notes, and snippets.

var hashKey = "id";
var rangeKey = null;
var tableName = "alert";
var scanParams = {
TableName: tableName,
};
docClient.scan(scanParams, function(err, data) {
if (err) ppJson(err); // an error occurred
@springfred
springfred / nodejs-tcp-example.js
Created May 14, 2018 07:07 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
*.tmp
# Word temporary
~$*.doc*
# Excel temporary
~$*.xls*
# Excel Backup File
*.xlk
@springfred
springfred / git_newrepo
Created August 17, 2018 02:41 — forked from c0ldlimit/git_newrepo
Git: Push a new or existing repo to Github
# Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line
@springfred
springfred / sync-upstream.sh
Created August 21, 2018 01:36 — forked from Juraci/sync-upstream.sh
Bash script to sync a forked project with its upstream repository
#/bin/bash
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
upstream=$1
branch=$2
# checks if there is a remote repo called upstream
check_upstream() {
@springfred
springfred / INSTALL.txt
Created August 21, 2018 01:36 — forked from fernandoaleman/INSTALL.txt
Shell script to sync remote branches from upstream and push them up to forked origin
1. Copy 'git-sync-fork' script code from gist
2. Create a file called 'git-sync-fork' in any 'bin' directory in your $PATH
3. Paste script into this new file 'git-sync-fork' and save
4. Make the file executable `chmod +x git-sync-fork`
5. Run the script inside your locally forked git repo
Example:
git-sync-fork upstream origin