This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When you need only 1 records, use Limit 1 | |
SELECT * FROM default_users WHERE username='juliosguz' LIMIT 1; | |
# Try to not use undetermined functions like : RND(),NOW(),CURDATE() in your queries, because some times MySql disable cache for that | |
SELECT * FROM default_users WHERE birthday >= NOW(); # BAD | |
SELECT * FROM default_users ORDER BY RAND(); # BAD ++ !!!! | |
SELECT * FROM default_users WHERE birthday >= 1419032756; #GOOD , this value maybe you can get with time() function in php for example | |
# Avoid NULL fields in your tables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mysqlslap --concurrency=20 --iterations=1 --query="QUERY" --create-schema="DATABASE" --user="USER" --password="PASSWORD" --host="HOST" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ssh root@IP-DOMAIN 'bash -s' < FILE.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: blog #nombre de tu aplicación | |
version: 1 #el numero de version de proyecto | |
runtime: php #lenguaje que usaras en tu proyecto | |
api_version: 1 #la version del runtime que estas usando | |
handlers: | |
- url: /.* #enviaremos todo lo que entre a index.php | |
script: index.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install rbenv ruby-build | |
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc | |
echo 'eval "$(rbenv init -)"' >> ~/.zshrc | |
rbenv install 2.2.3 | |
rbenv global 2.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.fontSize": 14, | |
"editor.tabSize": 2, | |
"editor.detectIndentation": false, | |
"editor.renderWhitespace": "boundary", | |
"window.zoomLevel": 1, | |
"vsicons.projectDetection.autoReload": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Authentication | |
users | |
{ | |
user1: { | |
email: 'julio.sguz@gmail.com', | |
proveedor: 'email', | |
creationDate: '12-04-2016' | |
}, | |
user2: { | |
email: 'vania@gmail.com', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This script is based from https://medium.com/@natchiketa/angular-cli-and-os-environment-variables-4cfa3b849659 | |
import { writeFile } from 'fs'; | |
import { argv } from 'yargs'; | |
const environment = argv.environment; | |
const isProd = environment === 'prod'; | |
require('dotenv').config({path: `./set-env/.env.${environment}`}); | |
const targetPath = `./src/environments/environment.${environment}.ts`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install -g firebase-tools | |
git clone https://github.com/juliosguz/firebase-workshop | |
cd firebase-workshop | |
firebase init | |
firebase serve | |
// Subir data de pruebaˇ | |
firebase database:push data-structure/posts-data.json /posts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from "@angular/core"; | |
import { Routes } from "@angular/router"; | |
import { NativeScriptRouterModule } from "nativescript-angular/router"; | |
const routes: Routes = []; | |
@NgModule({ | |
imports: [NativeScriptRouterModule.forChild(routes)], | |
exports: [NativeScriptRouterModule] | |
}) |
OlderNewer