Skip to content

Instantly share code, notes, and snippets.

HazElement hazelement

Block or report user

Report or block hazelement

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hazelement
hazelement / dropbox_git.md
Created Dec 31, 2015 — forked from trey/dropbox_git.md
Using Dropbox to Share Git Repositories
View dropbox_git.md

Using Dropbox to Share Git Repositories

First, create a Git subfolder inside your Dropbox folder. Then you can share the individual projects inside that folder with whomever you want (or just use it for instant offsite backups).

From inside a Git project:

git clone --bare . ~/Dropbox/Git/gitproject.git
git remote add dropbox ~/Dropbox/Git/gitproject.git

When you're ready to push:

@hazelement
hazelement / Morningstar API.md
Created Feb 3, 2016 — forked from hahnicity/Morningstar API.md
A brief description on how to use Morningstar's API
View Morningstar API.md

Morningstar API

If you're interested in grabbing Morningstar data but cash strapped there are ways to do it without actually paying for it.

Historical Price API

The following URL will get you access to all available historical Morningstar price data for the Ford Corporation

http://globalquote.morningstar.com/globalcomponent/RealtimeHistoricalStockData.ashx?ticker=F&showVol=true&dtype=his&f=d&curry=USD&range=1900-1-1|2014-10-10&isD=true&isS=true&hasF=true&ProdCode=DIRECT 

Now you will have every single daily piece of data for Ford between the dates of 01/01/1900 and 10/10/2014

View python_iterrate.py
# pandas dataframe
for index, row in df.iterrows():
print row['c1'], row['c2']
# dictionary
for key, value in d.iteritems():
print(key, value)
View user.sql
/* create user with password */
CREATE USER xxx WITH ENCRYPTED PASSWORD 'xxxxxxx';
/* set permissions */
GRANT CONNECT ON DATABASE mydb TO xxx;
GRANT USAGE ON SCHEMA public TO xxx;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO xxx;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO xxx;
View abstract_class.py
# python 2
from abc import abstractmethod, ABCMeta
ABC = ABCMeta('ABC', (object,), {'__slots__': ()})
class AbstractClassExample(ABC):
@abstractmethod
def do_something(self):
pass
@hazelement
hazelement / cryptokitties.sol
Created Oct 24, 2018 — forked from arpit/cryptokitties.sol
Cryptokitties Contract from the Eth blockchain
View cryptokitties.sol
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".
*/
contract Ownable {
address public owner;
@hazelement
hazelement / .tmux.conf
Last active Oct 26, 2018
machine_config
View .tmux.conf
# Uncomment the lines with the options you want to activate (by deleting the preceding "#")
# Allow mouse interaction
# set-option -g mouse on
# set prefix key
# set -g prefix M-space
# set -g prefix M
# unbind C-b
# bind-key M send-prefix
View site.conf
http {
server {
// redirect all to 443
listen 80 default server;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate www.example.com.crt;
@hazelement
hazelement / launch.json
Last active Jan 15, 2019
VSCode setting for C/C++ Project
View launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "debug",
"type": "cppdbg",
"request": "launch",
View executable-CMakeLists.txt
cmake_minimum_required(VERSION 2.8.9)
project (TestLibrary)
#For the shared library:
set ( PROJECT_LINK_LIBS libtestStudent.so )
link_directories( ~/exploringBB/extras/cmake/studentlib_shared/build )
#For the static library:
#set ( PROJECT_LINK_LIBS libtestStudent.a )
#link_directories( ~/exploringBB/extras/cmake/studentlib_static/build )
You can’t perform that action at this time.