Skip to content

Instantly share code, notes, and snippets.

@iforwms
iforwms / create_db.sql
Created September 26, 2018 06:09
Create MySQL DB from CLI
CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@iforwms
iforwms / labels.json
Last active October 26, 2018 13:47
Github Issue Labels
[
{ "name": ":octocat: customer", "description": "Issue was submitted via issue form", "color": "#db9df2" },
{ "name": ":moneybag: subscription", "description": "Payment or subscription-related", "color": "#ee3f46" },
{ "name": ":iphone: android", "description": "Android-related", "color": "#bfd4f2" },
{ "name": ":iphone: ios", "description": "iOS-related", "color": "#bfd4f2" },
{ "name": ":computer: web", "description": "Website-related", "color": "#bfd4f2" },
{ "name": ":cloud: server", "description": "Server-related", "color": "#bfd4f2" },
{ "name": ":skull: bug", "description": "Self-explanatory", "color": "#ee3f46" },
@iforwms
iforwms / mysqldump.txt
Last active September 29, 2018 05:18
mysqldump commands
https://stackoverflow.com/questions/13484667/downloading-mysql-dump-from-command-line
If it's an entire DB, then:
$ mysqldump -u [uname] -p[pass] db_name > db_backup.sql
If it's all DBs, then:
$ mysqldump -u [uname] -p[pass] --all-databases > all_db_backup.sql
If it's specific tables within a DB, then:
$ mysqldump -u [uname] -p[pass] db_name table1 table2 > table_backup.sql
@iforwms
iforwms / git-actions.txt
Last active October 11, 2018 08:03
Git Repo Actions
### Temporarily switch to a different commit
# If you want to temporarily go back to it, fool around, then come back to where you are, all you have to do is check out the desired commit:
# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32
Or if you want to make commits while you're there, go ahead and make a new branch while you're at it:
git checkout -b old-state 0d1d7fc32
# This will destroy any local modifications.
@iforwms
iforwms / drop-tables.txt
Created October 11, 2018 09:28
Drop all SQL tables
mysqldump --add-drop-table --no-data -u root -p DB_NAME | grep 'DROP TABLE' > drop_all_tables.sql
mysql -u root -p DB_NAME < drop_all_tables.sql
===================
drop database DB_NAME;
===================
SET FOREIGN_KEY_CHECKS = 0;
@iforwms
iforwms / clone-repo.md
Last active October 26, 2018 09:50
Move a repository from one owner to another

Fetch from original repo git fetch origin

We can check for any missing branches that we need to create a local copy of: git branch -a

git remote add new-origin NEW_REPO_URL

Now we are ready to push all local branches and tags to the new remote named new-origin: git push --all new-origin

@iforwms
iforwms / bundle-react-assets
Created November 8, 2018 15:48
Bundle react assets
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
@iforwms
iforwms / post-merge
Created December 3, 2018 04:25
Git post merge hook for React Apps
#!/bin/bash
yarn
yarn build
date +%T -s "HH:MM:SS"

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip