Skip to content

Instantly share code, notes, and snippets.

View tim-hub's full-sized avatar
:octocat:
Patience is Love

Tim tim-hub

:octocat:
Patience is Love
View GitHub Profile
@tim-hub
tim-hub / keybase.md
Created January 15, 2019 06:17
keybase.md

Keybase proof

I hereby claim:

  • I am tim-hub on github.
  • I am tim2015 (https://keybase.io/tim2015) on keybase.
  • I have a public key ASAkuXIMMGoiZXV11RGTv80nYCiBgKTCNLWG11nEXNKpdAo

To claim this, I am signing this object:

The contacts and profile information are collected for authentication by Google Firebase Authentication.
@tim-hub
tim-hub / kitties.sol
Created June 13, 2018 06:24
crypto kitties contracts.sol
// CryptoKitties Source code
// Copied from: https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code
pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
@tim-hub
tim-hub / avl.c
Created June 7, 2018 05:06 — forked from tonious/avl.c
A quick AVL tree implementation in c.
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
#include <assert.h>
struct avl_node_s {
@tim-hub
tim-hub / Ethereum_Genesis_exp.md
Last active June 6, 2018 23:18 — forked from 0mkara/Ethereum_private_network.md
Ethereum genesis.json example and Ethereum private network configuration guide.

Explanation of genesis file

  • mixhash

A 256-bit hash which proves, combined with the nonce, that a sufficient amount of computation has been carried out on this block: the Proof-of-Work (PoF).

The combination of nonce and mixhash must satisfy a mathematical condition described in the Yellowpaper, 4.3.4. Block Header Validity, (44). It allows to verify that the Block has really been cryptographically mined, thus, from this aspect, is valid.

The value is a reduced representation (using a simple Fowler–Noll–Vo hash function) of the set of values selected from the DAG data file during mining calculation. This selection pick follows the implemented Estah' Hashimoto algorithm, which depends on the given Block header. The applied mixhash is re-determined for each hash operation that a Miner performs while searching for the correct Block nonce (cf. ASIC resistance, high IO). The final Block mixhash is the value leading to the valid Block. The reason why this value is part of the Block descriptor is tha

@tim-hub
tim-hub / 1sales_based_on_cities.sql
Last active March 26, 2018 00:19
Assignment Data Warehouse Sql To test to get data from northwind 3 and 4, top 100 results. This is only for checking the data before and after you merger your data, SQL codes' author is Tim, Keep all rights.
-- Assignment Data Warehouse Sql To test get data from northwind 3 and 4
use northwind3 -- or 4
go
SELECT TOP(100) c.city, sum((1-od.Discount) * od.UnitPrice * Quantity) as Amount
From [Order Details] od, Orders o, Customers c
Where od.OrderID = o.OrderID and o.CustomerID = c. CustomerID
GROUP BY c.CITY;
@tim-hub
tim-hub / vue-custom-input-component-exercise.js
Created May 10, 2017 05:45 — forked from laracasts/vue-custom-input-component-exercise.js
vuecasts.com - Custom Input Components exercise.
Vue.component('coupon', {
props: ['code'],
template: `
<input type="text"
:value="code"
@input="updateCode($event.target.value)"
ref="input">
`,
@tim-hub
tim-hub / Redis Cluster Flask Cache.md
Created April 28, 2017 07:59 — forked from Richard-Mathie/Redis Cluster Flask Cache.md
Redis Cluster plugin for Flask Cache

Flask Cache Redis Cluster Backend

This impliments a redis cluster backend for Flask-Cache as the standard redis cache cannot handle a redis cluster.

Usage

class Config(object):
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@tim-hub
tim-hub / flask run.sh
Last active March 11, 2017 08:00
run flask app locally redhat cloud openshift
export FLASK_APP=wsgi.py
export FLASK_DEBUG=1
flask run