Skip to content

Instantly share code, notes, and snippets.

@nayzawoo
nayzawoo / pricing-ec2-vs-digitalocean.md
Created June 25, 2017 10:15 — forked from jbenner-radham/pricing-ec2-vs-digitalocean.md
Pricing comparison for Amazon AWS EC2 vs. Digital Ocean

Amazon EC2 and DigitalOcean Comparison

              | EC2 Small (previous gen) | Digital Ocean 2GB

-----------------|--------------------------|------------------ Hourly Price | $0.044 | $0.03 Monthy Price | $32 | $20 RAM | 1.7GB | 2GB HDD | 160GB | 40GB (SDD) CPU | x1 | x2 Monthy Transfer | 1GB | 3TB

@nayzawoo
nayzawoo / backup.sh
Created May 4, 2017 07:02
Mongodb/files backup bash
#!/bin/bash
# sudo midir /var/www/backups
# sudo database/backup
MONGO_DATABASE="my_app_db"
APP_NAME="my_app"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
<%
' FCKeditor - The text editor for Internet - http://www.fckeditor.net
' Copyright (C) 2003-2008 Frederico Caldeira Knabben
'
' == BEGIN LICENSE ==
'
' Licensed under the terms of any of the following licenses at your
' choice:
'
' - GNU General Public License Version 2 or later (the "GPL")
[user]
email = [email protected]
name = Nay Zaw Oo
[alias]
l0g1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
log2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
log = !"git lg1"
[credential]
helper = cache --timeout=3600
@nayzawoo
nayzawoo / autocomplete.php
Created December 10, 2016 09:01 — forked from imranismail/autocomplete.php
Laravel And JqueryUI's Autocomplete Plugin
//SearchController.php
public function autocomplete(){
$term = Input::get('term');
$results = array();
$queries = DB::table('users')
->where('first_name', 'LIKE', '%'.$term.'%')
->orWhere('last_name', 'LIKE', '%'.$term.'%')
->take(5)->get();