Skip to content

Instantly share code, notes, and snippets.

View dublado's full-sized avatar
📭
Send me a Telegram

Thiago Machado dublado

📭
Send me a Telegram
View GitHub Profile
@dublado
dublado / curl.md
Created August 19, 2019 17:23 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@dublado
dublado / SampleWebsiteCodeMinerActivity.java
Created June 2, 2019 23:09 — forked from ardovic/SampleWebsiteCodeMinerActivity.java
Sample of how to get any website source code as text (Android Activity)
import android.content.SharedPreferences;
import android.os.StrictMode;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import org.apache.http.HttpEntity;
@dublado
dublado / js_cookie.js
Created May 28, 2019 02:03 — forked from fabware/js_cookie.js
javascript cookie
@dublado
dublado / com.startup.plist
Created January 19, 2019 17:27 — forked from codeZoner/com.startup.plist
Launch Demon Start up with Bash Script with MySQL Example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- Launch Daemon do not always have access to all the path variables
As a results, scripts will sometimes fail if the you are using path variables inside them
To enable the script to have access to all path variables, open up a terminal and type in -->
<!-- echo $PATH -->
<!-- You can opt to filter out some of the path variables which are not required by script-->
<key>EnvironmentVariables</key>
@dublado
dublado / regexCheatsheet.js
Last active January 15, 2019 16:49 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@dublado
dublado / nginx.conf
Created October 8, 2018 15:18 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@dublado
dublado / sniff.txt
Created August 30, 2018 18:47 — forked from manifestinteractive/sniff.txt
A friendly formatter for curl requests to help with debugging.
\n
============= HOST: ==========\n
\n
local_ip: %{local_ip}\n
local_port: %{local_port}\n
remote_ip: %{remote_ip}\n
remote_port: %{remote_port}\n
\n
======= CONNECTION: ==========\n
\n
@dublado
dublado / content-product.php
Created June 8, 2018 03:37 — forked from DerekFoulk/content-product.php
Attempt to hide products with certain tag (WooCommerce)
<?php
/**
* The template for displaying product content within loops.
*
* Override this template by copying it to yourtheme/woocommerce/content-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.4.0
*/
@dublado
dublado / functions.php
Created June 8, 2018 03:26 — forked from claudiosanches/functions.php
WooCommerce - Show add to cart button only for logged users
<?php
function woocommerce_template_loop_add_to_cart() {
if ( is_user_logged_in() )
woocommerce_get_template( 'loop/add-to-cart.php' );
}
function woocommerce_template_single_add_to_cart() {
if ( is_user_logged_in() ) {
global $product;
@dublado
dublado / functions.php
Created June 8, 2018 03:26 — forked from claudiosanches/functions.php
WooCommerce - Display price only for logged in users
<?php
function cs_prices_only_for_logged_in_users() {
if ( ! is_user_logged_in() && ! is_admin() ) {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
}
}
add_action( 'init', 'cs_prices_only_for_logged_in_users' );