- Create a .gitignore file in the git repository if it does not contain one
touch .gitignore
2. Open up the .gitignore and add the following line to the file
node_modules 3. Remove the node_modules folder from the git repository
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Support\Facades\File; | |
class extractTranslationStrings extends Command | |
{ |
# Code below will show the truncate code for all tables in desired schema | |
SELECT | |
Concat('TRUNCATE TABLE ', TABLE_NAME, ';') | |
FROM | |
INFORMATION_SCHEMA.TABLES | |
WHERE | |
table_schema = 'your-table'; | |
# disabling foreign checks for a while | |
SET FOREIGN_KEY_CHECKS=0; |
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear! | |
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy. | |
* Off the top of my head * | |
1. Fork their repo on Github | |
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it | |
git remote add my-fork [email protected] |
<?php | |
class ApiRequest extends FormRequest | |
{ | |
protected function validationData() | |
{ | |
return count($this->json()->all()) ? $this->json()->all() : $this->all(); | |
} | |
} |
<?php | |
require dirname(__FILE__).'/wp-blog-header.php'; | |
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')"); | |
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'"); | |
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)"); | |
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))"); | |
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))"); | |
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')"); |
echo "export default {" && grep -R '\$t(' resources/assets/js/* | sed "s/^.*(['\"]//g" | sed "s/['\"].*$//g" | sort | uniq | while read -r a; do echo " "\"$a\": \"\"; done && echo "}" |
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
alias ls='ls -GFh' |
/* | |
Write permission is necessary in your AndroidManifest.xml. | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
*/ | |
try { | |
//Defining your external storage path. | |
String extStore = Environment.getExternalStorageDirectory().getPath(); | |
//Defining the file to be opened. | |
File dbfile = new File(extStore + "/yourdatabase.db"); |
<?php | |
class Tools { | |
public static function generateLaravelHash($cost, $salt, $pass) | |
{ | |
return password_hash($pass, PASSWORD_BCRYPT, [ | |
'cost' => $cost, | |
'salt' => $salt | |
]); |