Skip to content

Instantly share code, notes, and snippets.

View mikebarkas's full-sized avatar

Mike Barkas mikebarkas

View GitHub Profile
def us_states():
return [
('AK', 'Alaska'),
('AL', 'Alabama'),
('AR', 'Arkansas'),
('AZ', 'Arizona'),
('CA', 'California'),
('CO', 'Colorado'),
('CT', 'Connecticut'),
('DC', 'District of Columbia'),
@mikebarkas
mikebarkas / gist:68d0f6288d77742eccf70049bab40a05
Created April 12, 2016 15:02
PHP5.6 SSL Stream Wrapper Issues
// For local development, remove the SSL certificate check.
$client_options = array(
'trace' => 'example_trace',
'soap_version' => 'example_version',
'stream_context' => stream_context_create(
array(
'ssl' => array(
'verify_peer' => FALSE,
'verify_peer_name' => FALSE,
)
$(function () {
var activeurl = window.location;
$('a[href="' + activeurl + '"]').parent('li').addClass('active');
});
@mikebarkas
mikebarkas / less-config
Created February 8, 2015 22:33
Keep less output in terminal.
// Application specific.
git config --global --replace-all core.pager "less -iXFR"
// Global system configuration.
// For Bash or Zsh.
export LESS=-iXFR
/*
* -i - ignore case when searching
* -X - do not clear screen on exit
" Show syntax highlighting groups for word under cursor
nmap <leader>z :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
@mikebarkas
mikebarkas / .gitignore
Last active August 29, 2015 14:08 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@mikebarkas
mikebarkas / gist:6480fa31020a692e62e2
Last active August 29, 2015 14:08
Disable chrome origin poicy

OSX: $ open -a Google\ Chrome --args --disable-web-security

Linux: $ google-chrome --disable-web-security

AJAX,JSON flags: -–allow-file-access-from-files

PC from directory with exe:

@mikebarkas
mikebarkas / osx-term-color
Last active August 29, 2015 14:05
OSX terminal color definitions.
#
# .bash_profile
#
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
#
# Postion definition (foreground/background).
#
# 1. directory
tcpdump -nl -I eth0 -c500 port 8880