Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / ERC20.sol
Created January 12, 2018 01:51
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.19+commit.c4cbbb05.js&optimize=false&gist=
pragma solidity ^0.4.10;
interface ERC20 {
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
@rkuzsma
rkuzsma / gist:b9a0e342c56479f5e58d654b1341f01e
Last active September 19, 2022 17:16
Example Kubernetes yaml to pull a private DockerHub image
Step by step how to pull a private DockerHub hosted image in a Kubernetes YML.
export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/
export DOCKER_USER=Type your dockerhub username, same as when you `docker login`
export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login`
kubectl create secret docker-registry myregistrykey \
--docker-server=$DOCKER_REGISTRY_SERVER \
--docker-username=$DOCKER_USER \
@cmoulton
cmoulton / UISwiftRestDemo
Last active September 9, 2021 21:01
Quick & dirty REST API calls with Swift 2.2. See http://grokswift.com/simple-rest-with-swift/
// MARK: Using NSURLSession
// Get first todo item
let todoEndpoint: String = "http://jsonplaceholder.typicode.com/todos/1"
guard let url = NSURL(string: todoEndpoint) else {
print("Error: cannot create URL")
return
}
let urlRequest = NSURLRequest(URL: url)
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 6, 2024 02:17
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@avalez
avalez / login.js
Created November 30, 2013 18:33
Bitbucket OAuth consumer example (nodejs w. passport)
var passport = require('passport'),
BitbucketStrategy = require('passport-bitbucket').Strategy,
request = require('request');
module.exports = function (app) {
var oauth = {
consumer_key: process.env.BB_CONSUMER_KEY,
consumer_secret: process.env.BB_CONSUMER_SECRET
};
@naiquevin
naiquevin / thankyou.py
Last active September 16, 2020 16:09
Python script to thank people who sent birthday wishes on facebook
import sys
from urllib import urlencode
import requests
from urlparse import urlparse, parse_qs
from random import choice
import re
self_id = None # your facebook id here
utc_bday = None # utc timestamp of your birthday
@melodymorgan
melodymorgan / getLatestData.js
Created October 18, 2012 19:09
Rickshaw Update Graph Realtime Data
var seriesData = [ [{ x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 17 }, { x: 3, y: 42 }] ];
var graph = new Rickshaw.Graph( {
element: document.getElementById("chart"),
width: 940,
height: 250,
renderer: 'area',
stroke: true,
series: [
{
color: 'steelblue',
@arvis
arvis / app.js
Created August 15, 2012 08:46
Basic express and mongoose CRUD application
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http')
, mongoose = require('mongoose')
, path = require('path');