Skip to content

Instantly share code, notes, and snippets.

View itsfreddyrb's full-sized avatar
🎯
Focusing

itsfreddyrb itsfreddyrb

🎯
Focusing
View GitHub Profile
@itsfreddyrb
itsfreddyrb / cachegithubcredentials
Last active April 13, 2020 03:48
Cache github credentials
git config --global credential.helper cache -timeout=3600
//Store username and password persistent
/*
Run git pull if you want to change the password later, after changing the password on github we run git pull or some other command and the user will fail, run the command again.
*/
git config --global credential.helper store
netstat -ntu|awk '{print $5}'|cut -d: -f1 -s|sort|uniq -c|sort -nk1 -r
@itsfreddyrb
itsfreddyrb / gist:6d6d3054a1118a615370b6ff15d206be
Created April 8, 2019 15:48
WC_Vendors Woocommerce restrict buying from multiple vendors
add_action('woocommerce_add_to_cart', 'custom_add_to_cart');
function custom_add_to_cart() {
global $woocommerce;
$items = $woocommerce->cart->get_cart();
$cart_products = array();
$remove_this_items = array();
//Get all the items in the cart
//@version=3
strategy("My Strategy", overlay=true, currency=currency.USD, default_qty_type=strategy.cash, default_qty_value=4000)
//src = close, len = input(35)
//ema = ema(src,len)
//plot(ema,color = blue, linewidth = 2, style = line)
short = ema(close, 20)
medium = ema(close, 50)
long = ema(close, 200)
study(title="FibFib", shorttitle="AutoFib", overlay=true)
fiblength=input(265)
maxr = highest(close, fiblength)
minr = lowest(close, fiblength)
ranr = maxr - minr
ON=plot( maxr , color=black, title="1" )
SS=plot( maxr - 0.236 * ranr, title="0.764", color=#3399FF )
SO=plot( maxr - 0.382 * ranr, title="0.618", color=blue )
FI=plot( maxr - 0.50 * ranr, title="0.5", color=lime )
//@version=2
study("Levels", overlay = true)
showDay = input(true, "Previous Day")
showWeek = input(true, "Previous Week")
showMonth = input(true, "Previous Month")
plot(showDay ? security(tickerid, "D", close[1]) : na, title = "Previous Day Close", color = #00FFFF, linewidth = 1, style = circles)
plot(showDay ? security(tickerid, "D", high[1]) : na, title = "Previous Day High", color = #FF00FF, linewidth = 1, style = circles)
plot(showDay ? security(tickerid, "D", low[1]) : na, title = "Previous Day Low", color = #0033FF, linewidth = 1, style = circles)
@itsfreddyrb
itsfreddyrb / password_hashing_api.md
Created October 12, 2017 21:09 — forked from nikic/password_hashing_api.md
The new Secure Password Hashing API in PHP 5.5

The new Secure Password Hashing API in PHP 5.5

The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:

Why do we need a new API?

Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.

add_filter( 'body_class', function($classes) {
global $post;
$terms = get_the_terms($post->ID, 'project_category');
foreach( $terms as $term ) {
$supertax[] = $term->name;
}
return array_merge( $classes , $supertax );
});
@itsfreddyrb
itsfreddyrb / Ads Host File
Created July 16, 2016 20:23
URL of Host that deliver Ads
# Ads servers
127.0.0.1 *.30daychange.co
127.0.0.1 *.4dsply.com
127.0.0.1 *.ad-center.com
127.0.0.1 *.ad126m.com
127.0.0.1 *.adbooth.net
127.0.0.1 *.adcash.com
127.0.0.1 *.adk2x.com
127.0.0.1 *.adnxs.com
127.0.0.1 *.adpdx.com