Skip to content

Instantly share code, notes, and snippets.

View pije76's full-sized avatar

panjianom pije76

View GitHub Profile
@pije76
pije76 / filter.php
Created June 16, 2019 12:33 — forked from plusplugins/filter.php
Adding a custom field to Ultimate Members directory search options
add_filter('um_admin_custom_search_filters','add_my_custom_search_fields', 10, 1);
function add_my_custom_search_fields($fields) {
$fields['field_meta_key'] = array('title' => 'Enter field title'); // replace 'field_meta_key' with your field meta key
return $fields;
}
@pije76
pije76 / Heroku Database.md
Created May 21, 2018 04:22 — forked from stevenyap/Heroku Database.md
Heroku for backup, exporting and importing database

Note: You need to have to Heroku PGBackup addon first heroku addons:add pgbackups..

Importing Heroku PG DB to local

Creates the backup on heroku first:

heroku pgbackups:capture
@pije76
pije76 / cot.cad.R
Created April 9, 2018 11:45 — forked from creative-quant/cot.cad.R
COT - CAD
############################################################
## Content of the Traders in Financial Futures (TFF) Report
## http://www.cftc.gov/ucm/groups/public/@commitmentsoftraders/documents/file/tfmexplanatorynotes.pdf
############################################################
# Dealer/Intermediary
# These participants are what are typically described as the "sell side” of the market. Though they
# may not predominately sell futures, they do design and sell various financial assets to clients.
# They tend to have matched books or offset their risk across markets and clients. Futures
# contracts are part of the pricing and balancing of risk associated with the products they sell and
# their activities. These include large banks (U.S. and non-U.S.) and dealers in securities, swaps
@pije76
pije76 / forexfactory_econcal.py
Created April 9, 2018 11:12 — forked from pohzipohzi/forexfactory_econcal.py
A scraper for forex factory economic calendar data
from bs4 import BeautifulSoup
import requests
import datetime
import logging
import csv
def setLogger():
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s',
filename='logs_file',
@pije76
pije76 / symfony-tips1-prod-dev.md
Created November 22, 2017 10:50 — forked from samsonasik/symfony-tips1-prod-dev.md
symfony tips 1 - switch dev - prod or prod - dev again
@pije76
pije76 / gist:dd62555bea2d1aa227acfc51974fc49a
Created August 29, 2017 21:07 — forked from timohausmann/gist:4997956
Javascript Math: get degree between two points
/**
* return the angle between two points.
*
* @param {number} x1 x position of first point
* @param {number} y1 y position of first point
* @param {number} x2 x position of second point
* @param {number} y2 y position of second point
* @return {number} angle between two points (in radian)
*/
Math.getAngle = function( x1, y1, x2, y2 ) {
@pije76
pije76 / bench.py
Created August 28, 2017 13:14 — forked from boblefrag/bench.py
list comprehension vs for loop python
import time
import pprint
phrase = """ Britney Jean Spears (born December 2, 1981) is an American singer, dancer and actress. Born in
McComb, Mississippi, and raised in Kentwood, Louisiana, she performed acting roles in stage
productions and television shows as a child before signing with Jive Records in 1997. Spears's first
and second studio albums, ...Baby One More Time (1999) and Oops!... I Did It Again (2000), became
international successes, with the former becoming the best-selling album by a teenage solo
artist.[1] Title tracks "...Baby One More Time" and "Oops!... I Did It Again" broke international
sales records. In 2001, Spears released her self-titled third studio album, Britney, and played the
@pije76
pije76 / kepler.py
Created August 28, 2017 03:30 — forked from zeimusu/kepler.py
Models orbits using keplers equations, then tries to makes sounds from them.
import math
#import sys
#import sunau
#import array
"""
ecc=0.5
P=1
p=1
if len(sys.argv)>1:
ecc=float(sys.argv[1])
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from cogs.utils.dataIO import dataIO
from __main__ import send_cmd_help
from discord.ext import commands
import asyncio
import random
from flatlib.datetime import Datetime
from flatlib.geopos import GeoPos
from flatlib.chart import Chart
from flatlib.aspects import getAspect
from flatlib import const
wise_connective = ['in', 'with', 'for', 'as']
aspects = {}
aspects['applicative'] = {