Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / sample.js
Created July 6, 2016 21:28 — forked from chrisabrams/sample.js
Bluebird promise chain example
Promise = require('bluebird')
var A = function() {
return new Promise(function(resolve, reject) {
var result = 'A is done'
console.log(result)
resolve(result);
})
@cicorias
cicorias / Example1.cs
Created August 29, 2016 01:49 — forked from davidfowl/Example1.cs
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@cicorias
cicorias / node-and-npm-in-30-seconds.sh
Created November 18, 2016 16:37 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@cicorias
cicorias / backup-github.sh
Created November 22, 2016 16:08 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
@cicorias
cicorias / backup_github.sh
Created November 22, 2016 16:09 — forked from xaprb/backup_github.sh
Shell script to back up all of an organization's GitHub repos
#!/bin/sh
LOGIN=YOURLOGIN
TOKEN=YOURTOKEN
ORG=YOURORG
DONE=0
PAGE=0
# sample output:
# "total_private_repos": 50,
@cicorias
cicorias / wifi_scan.m
Last active December 22, 2016 16:14 — forked from pavel-a/wifi_scan.m
Wi-Fi scan for Apple OS X (maybe works for iOS too)
//
// wifi_scan.m
// WifiDump
//
// Created by Shawn Cicoria on 12/22/16.
// Copyright © 2016 CedarLogic, LLC. All rights reserved.
//
/* The official example for CoreWLAN is now obsolete,
@cicorias
cicorias / npm-upgrade-bleeding.sh
Created December 30, 2016 20:54 — forked from othiym23/npm-upgrade-bleeding.sh
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
contract EscrowContract {
address buyer;
address seller;
address agent;
// Each party has an entry here with the timestamp of their acceptance
uint[3] acceptances;
bool active;
@cicorias
cicorias / PriceFeed_cryptocompare
Created March 10, 2017 04:03 — forked from anonymous/PriceFeed_cryptocompare
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.9+commit.364da425.js&optimize=undefined&gist=
// Ethereum + Solidity
// This code sample & more @ dev.oraclize.it
import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";
contract PriceFeed is usingOraclize {
uint public ETHUSD;
function PriceFeed(){
oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS);