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 / 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 / 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 / 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 / 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".
*/
The contacts and profile information are collected for authentication by Google Firebase Authentication.
@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:

@tim-hub
tim-hub / README.md
Created January 29, 2019 03:55 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@tim-hub
tim-hub / python_cd.py
Created January 31, 2019 02:13
a path class written in Python (with some test cases)
class Path:
def __init__(self, path):
self.current_path = path
def cd(self, new_path):
positions = self.current_path.split('/')
if new_path == '/..':
return None
function get_browser() {
var ua = navigator.userAgent,
tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if (/trident/i.test(M[1])) {
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
return {
name: 'IE',
version: (tem[1] || '')
};
}
@tim-hub
tim-hub / 0.gif
Created June 17, 2019 09:51 — forked from simon300000/kkomda.jpg
→_→
0.gif