Skip to content

Instantly share code, notes, and snippets.

View h3nr1ke's full-sized avatar
🤔
Should I?

H3NR1KE h3nr1ke

🤔
Should I?
View GitHub Profile
@h3nr1ke
h3nr1ke / rename.bat
Last active February 5, 2018 21:51
Rename all files to a numeric sequence
:: initial count
SET i=0
setlocal EnableDelayedExpansion
:: filter for extension, jpg as example
for %%f in (*.jpg) do (
:: rename the current file to the new name
ren "%%~nf%%~xf" "!i!.jpg"
:: increase the counter
<?php
/**
* Arquivo de exemplo para descriptografar os dados do visa checkout apos validacao do usuario
* este codigo esta na documentacao disponivel em
* https://developer.visa.com/capabilities/visa_checkout/docs
*
*/
/**
* Exeuta o primeiro nivel de descriptografia
@h3nr1ke
h3nr1ke / UsefulGitCommands.txt
Last active April 3, 2018 15:06
Useful git tips
#--- good resource
http://gitready.com/
#--- When you want to commit files that used to be ignored or vice versa
git rm -r --cached .
git add .
git commit -m "Commit follows the .gitignore again"
#--- Get the remote URL from a repository
git config --get remote.origin.url
@h3nr1ke
h3nr1ke / cordova.config.xml
Last active December 22, 2017 02:32
Example of config.xml configuration for cordova
<?xml version='1.0' encoding='utf-8'?>
<!-- Build version (iOS) and version code (android) -->
<widget android-versionCode="1" id="com.your.app" ios-CFBundleVersion="1" version="3.5.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<!-- Add plugin from local path -->
<plugin name="cordova-plugin-YOURPLUGIN" spec="./path/to/custom/plugins/cordova-plugin-YOURPLUGIN" />
</widget>
@h3nr1ke
h3nr1ke / adb.sh
Last active February 2, 2018 17:21
adb useful commands
# --- read only needed information from adb logcat
# adb logcat *:<OPTION>
#the priorites are (from lowest to highest )
# V — Verbose (lowest priority)
# D — Debug
# I — Info
# W — Warning
@h3nr1ke
h3nr1ke / NPM.sh
Created January 3, 2018 14:21
NPM commands to start and manage a projec
# --- install dependecies
npm install
# --- install only dev dependencies
npm install --only=dev
@h3nr1ke
h3nr1ke / usefulwordpress.php
Last active April 6, 2018 18:12
Useful Wordpress code
<?php
//==================================
// ONLY ONE ITEM IN THE CART AT TIME
//==================================
add_filter( 'woocommerce_add_cart_item_data', 'woo_custom_add_to_cart' );
function woo_custom_add_to_cart( $cart_item_data ) {
global $woocommerce;
// REMOVE ALL OTHER ITEMS
$woocommerce->cart->empty_cart();
@h3nr1ke
h3nr1ke / useful-ubuntu-server.sh
Last active April 2, 2018 18:44
maintenance commands ubuntu server
#restart nginx
service nginx restart
#restart php
service php7.0-fpm restart
#list all services running
service --status-all
#add path
@h3nr1ke
h3nr1ke / reactnative.sh
Created January 31, 2018 22:04
Installing RectNative using HomeBrew
#install the homebrew, makes our life easy
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#install react native tool
npm install -g create-react-native-app
@h3nr1ke
h3nr1ke / mysql.sh
Last active August 14, 2018 13:50
Access mysql remote server using command line
# if you dont have the tool
# apt-get install mysql-client
mysql -u [USER] -p[PASS] -h [REMOTE_HOST] [DATABASE_NAME]
# after this commmand, the prompt will be
# mysql>
# and will accept SQL commands
# mysql> Select * from yourtable;