Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Armno P. armno

🎯
Focusing
View GitHub Profile
@armno
armno / vim-plugins.md
Last active Dec 19, 2015
Vim plugins
View vim-plugins.md
@armno
armno / Preferences.sublime-settings
Last active Dec 19, 2015
My Sublime Text (3) User Settings
View Preferences.sublime-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",
View armno.zsh-theme
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 / .htaccess
Created Feb 15, 2013
Allowing Access-Control-Allow-Origin to multiple domains for Ajax requests
View .htaccess
# 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 / packages-list.md
Last active Oct 13, 2015
Sublime Text 2 Packages
View packages-list.md
@armno
armno / todo-after-install-ubuntu.md
Last active Oct 12, 2015
Things to do after I install Ubuntu
View todo-after-install-ubuntu.md
@armno
armno / .vimrc
Last active Oct 6, 2015
my .vimrc for gvim and (maybe) macvim at home
View .vimrc
" 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 / gist:2760611
Last active Oct 5, 2015
.bash_profile/.bashrc
View gist:2760611
# 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 / php-pdo.php
Created Mar 15, 2012
Simple Data Insertion using PHP PDO
View php-pdo.php
<?php
$hostname = 'localhost';
$username = 'root';
$password = 'root';
try {
$dbh = new PDO("mysql:host=$hostname;dbname=prod", $username, $password);
echo 'Connected to database';