Skip to content

Instantly share code, notes, and snippets.

@gys-dev
gys-dev / nginx.conf
Created February 15, 2019 15:31 — forked from chrisallenlane/nginx.conf
This is an nginx configuration that does the following: - Implements a RESTful API using CORS between `example.com` and `api.example.com` - Uses SSL - Reverse-proxies SSL traffic from port 443 to a NodeJS application running on port 8000 Adapted from this page, with thanks to the original author: http://enable-cors.org/server_nginx.html
# Configure the reverse-proxy on port 443
server {
# general configs
keepalive_timeout 30;
listen 127.0.0.1:443 ssl;
server_name api.example.com;
# ssl configs
ssl_certificate /path/to/api.crt;
ssl_certificate_key /path/to/api.key;
@gys-dev
gys-dev / CRUD_SP_Generation.sql
Created November 27, 2019 17:44 — forked from huobazi/CRUD_SP_Generation.sql
Generate CRUD stored procedures from tables in schema
-- #########################################################
-- Author: www.sqlbook.com
-- Copyright: (c) www.sqlbook.com. You are free to use and redistribute
-- this script as long as this comments section with the
-- author and copyright details are not altered.
-- Purpose: For a specified user defined table (or all user defined
-- tables) in the database this script generates 4 Stored
-- Procedure definitions with different Procedure name
-- suffixes:
-- 1) List all records in the table (suffix of _GetAll)
@gys-dev
gys-dev / AppNavigator.js
Created December 17, 2019 14:31
React Native  - Tab Navigation (navigators)
import React from 'react';
import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import BottomTabNavigator from './BottomTabNavigator';
export default createAppContainer(
createSwitchNavigator({
Main: BottomTabNavigator
})
);
@gys-dev
gys-dev / Firebase Database API Cheatsheet
Created February 15, 2020 14:10 — forked from odigity/Firebase Database API Cheatsheet
Firebase Database API Cheatsheet
There is no way to store an empty object/array/null value.
There are also no actual arrays. Array values get stored as objects with integer keys.
(If all keys are integers, it will be returned as an array.)
Basically, it's one giant tree of hashes with string keys.
Simply write a value to any location, and the intermediary locations will automatically come into existance.
── Classes ──
DataSnapshot : Container for a subtree of data at a particular location.
#!/bin/bash
BASE_DIR=`pwd`;
function remove_rctwebview(){
local dir="${BASE_DIR}/node_modules/react-native/React";
sed -i'.bak' '/RCTWebView/d' "${dir}/React.xcodeproj/project.pbxproj"
rm -f "${dir}/React.xcodeproj/project.pbxproj.bak"
rm -f "${dir}/Views/RCTWebView.m"
rm -f "${dir}/Views/RCTWebView.h"
@gys-dev
gys-dev / android_build_run.sh
Created September 21, 2020 16:14 — forked from aldemirenes/android_build_run.sh
Shell scripts for Android development without needing to use Android Studio
#!/bin/sh
package_name=$1
./gradlew assembleDebug
adb -d install -r app/build/outputs/apk/app-debug.apk
adb shell monkey -p "$package_name" -c android.intent.category.LAUNCHER 1
./logcat.sh "$package_name"