Skip to content

Instantly share code, notes, and snippets.

View armno's full-sized avatar
🚀

Armno P. armno

🚀
View GitHub Profile
@armno
armno / php-pdo.php
Created March 15, 2012 18:04
Simple Data Insertion using PHP PDO
<?php
$hostname = 'localhost';
$username = 'root';
$password = 'root';
try {
$dbh = new PDO("mysql:host=$hostname;dbname=prod", $username, $password);
echo 'Connected to database';
@armno
armno / gist:2760611
Last active October 5, 2015 05:58
.bash_profile/.bashrc
# rewrite prompt prefix
PS1='➜ '
# from nettuts
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
@armno
armno / .vimrc
Last active October 6, 2015 01:07
my .vimrc for gvim and (maybe) macvim at home
" no compatible with VI
set nocompatible
" start pathogen
execute pathogen#infect()
" Look and Feel
syntax on
colorscheme Tomorrow-Night
set guifont:Inconsolata\ for\ Powerline:h20
@armno
armno / todo-after-install-ubuntu.md
Last active October 12, 2015 13:57
Things to do after I install Ubuntu
@armno
armno / packages-list.md
Last active October 13, 2015 09:17
Sublime Text 2 Packages
@armno
armno / .htaccess
Created February 15, 2013 09:35
Allowing Access-Control-Allow-Origin to multiple domains for Ajax requests
# source: http://www.lowest-common-denominator.com/2010/01/http_access_control_to_multipl.php
# - replace `domain1.com` and `domain2.com`
# - add more domains by separating each domain with a pipe `|`
# - escape dot `.` with a backslash
<IfModule mod_headers.c>
SetEnvIf Origin "^http(s)?://(.+\.)?(domain1\.com|domain2\.com)$" origin_is=$0
Header always set Access-Control-Allow-Origin %{origin_is}e env=origin_is
</IfModule>
@armno
armno / armno.zsh-theme
Last active December 13, 2015 18:59
my zsh them
PROMPT='$fg_bold[red]~: $fg[yellow]$(get_pwd) $(git_prompt_info)
$reset_color➜ '
function get_pwd() {
echo "${PWD/$HOME/~}"
}
ZSH_THEME_GIT_PROMPT_PREFIX="$reset_color$fg[green]["
ZSH_THEME_GIT_PROMPT_SUFFIX="]"
ZSH_THEME_GIT_PROMPT_DIRTY="$fg_bold[red]+$reset_color$fg[green]"
@armno
armno / Preferences.sublime-settings
Last active December 19, 2015 11:09
My Sublime Text (3) User Settings
{
"bold_folder_labels": true,
// "theme": "Spacegray.sublime-theme",
"caret_style": "phase",
"detect_slow_plugin": false,
"fade_fold_buttons": false,
"folder_exclude_patterns":
[
".svn",
".git",
@armno
armno / vim-plugins.md
Last active December 19, 2015 14:59
Vim plugins
@armno
armno / app.scss
Created November 1, 2013 07:10
my css for phonegap projects
/* apply a natural box layout model to all elements */
*, *:before, *:after {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/* from http://devgeeks.github.io/presentation--none-of-the-above/#5 */
body {
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-touch-callout: none;
-webkit-text-size-adjust: none;