Skip to content

Instantly share code, notes, and snippets.

Avatar
🦉
Morning Owl

Dede Hamzah dehamzah

🦉
Morning Owl
View GitHub Profile
@dehamzah
dehamzah / now.json
Created Apr 14, 2020
now.json config url rewrite for react app
View now.json
{
"name": "supertesting-test2",
"alias": "supertesting-test2.now.sh",
"version": 2,
"builds": [
{
"src": "package.json",
"use": "@now/static-build"
}
],
@dehamzah
dehamzah / readme.md
Created Apr 14, 2020
Stop google bot crawling your web
View readme.md

in robots.txt

User-agent: *
Disallow: /

this will not allow the crawler access your website, will work if your web haven't been indexed.


@dehamzah
dehamzah / readme.md
Created Apr 12, 2020
react native 0.56.0 cannot find ios simulator in catalina
View readme.md

run this to debug available simulator

xcrun simctl list --json devices

basicly this json output is what react-native run-ios parse to find the matching simulator.


@dehamzah
dehamzah / script.sh
Created Mar 5, 2020
Generating new keystore
View script.sh
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
@dehamzah
dehamzah / run.sh
Last active Jun 30, 2020
Create read only mysql database user
View run.sh
# Login
$ mysql -u root -p
# Check privileges
$ SHOW GRANTS FOR 'read-only_user_name'@'%';
# Remove the privileges if any
$ REVOKE ALL PRIVILEGES ON database_name.* FROM 'read-only_user_name'@'%';
@dehamzah
dehamzah / .eslintrc
Created Jun 6, 2018
ES Lint Setup for React Native
View .eslintrc
{
"parser": "babel-eslint",
"env": {
"browser": true
},
"plugins": [
"react",
"react-native"
],
"ecmaFeatures": {
View gist:346dfdd5c3dc23281cce8e638cd15869
> $ gulp ⬡ 8.9.4 [±master ●●]
[07:03:45] Using gulpfile /media/dehamzah/ssd/projects/projects/bps-satu-data/satudata-mobile-ionic/gulpfile.js
[07:03:45] Starting 'sass'...
[07:03:45] Starting 'index'...
[07:03:45] Starting 'scripts'...
[07:03:45] Starting 'styles'...
[07:03:45] Starting 'clean-templates'...
[07:03:45] Starting 'clean-images'...
[07:03:45] Starting 'lib'...
info: Preening: ngCordova
View install-docker-on-linux-mint-18.sh
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/andrewelkins/1adc587feb610f586f8f40b50b7efc3a/install-docker-on-linux-mint-18.sh | bash -x
##########################################
# Kernel version http://stackoverflow.com/a/4024263
versionlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
versionlt() {
@dehamzah
dehamzah / pagination.js
Created Jan 22, 2018
Pagination like github
View pagination.js
function getDisplayedPages(currentPage, pagesArr) {
/*
Will return 5 total pages, with current page in the middle.
*/
var lastPage = pagesArr.length;
var first = (Math.sign(currentPage - 3) === -1) ? 0 : currentPage - 3;
var last = currentPage + 2;
if (currentPage > lastPage) return;