Skip to content

Instantly share code, notes, and snippets.

View mmoscosa's full-sized avatar
🚀
I may be slow to respond

Martin Moscosa mmoscosa

🚀
I may be slow to respond
View GitHub Profile
### Keybase proof
I hereby claim:
* I am mmoscosa on github.
* I am mmoscosa (https://keybase.io/mmoscosa) on keybase.
* I have a public key ASBiCiIODrWC4jK96O3PRv5JcjVT1jueK6TkyhYlxMsb3go
To claim this, I am signing this object:
### Keybase proof
I hereby claim:
* I am mmoscosa on github.
* I am mmoscosa (https://keybase.io/mmoscosa) on keybase.
* I have a public key ASB_UWWAc26IqxVgjvSZXe_rzMD5NdSm4nio8Kp6tvhQKQo
To claim this, I am signing this object:
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"font_options":
[
"gray_antialias"
],
"font_size": 13,
"ignored_packages":
@mmoscosa
mmoscosa / iTerm2 Snippets.md
Last active December 31, 2016 01:54
iTerm Snippets

##To remove iTerm from the dock:

/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist

##To restore iTerm to the dock:

/usr/libexec/PlistBuddy -c 'Delete :LSUIElement' /Applications/iTerm.app/Contents/Info.plist
@mmoscosa
mmoscosa / init.coffee
Last active July 12, 2016 20:08
Atom Sync Settings for multiplatform syncing Automatic update by http://atom.io/packages/sync-settings
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@mmoscosa
mmoscosa / Country Drop Down
Created February 21, 2014 23:25
Country Drop Down List for Web Forms: Source http://bit.ly/1jVR0rm
<select>
<option value=" " selected>(please select a country)</option>
<option value="--">none</option>
<option value="AF">Afghanistan</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
@mmoscosa
mmoscosa / NGINX Default server config
Last active December 28, 2015 22:39
NGINX Default server config
#
# The default server
#
server {
listen 80 default_server;
server_name blog.mmoscosa.com;
#charset koi8-r;
#access_log logs/host.access.log main;
<?php
/**
* Set up environment (development vs. production).
*/
$environment = 'production';
// Switch environment on hostname for requests coming through HTTP protocol
$hostname = !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : false;
$developmentHostnames = array(
'dev.test.peachymondays.com', // localhost development (mmoscosa)
'peachymondays_dev.mmoscosa.homelinux.net',
@mmoscosa
mmoscosa / sshProxy
Created January 21, 2013 15:31
Script to open a SSH proxy Tunneling using Socks
#!/bin/bash
if [[ -n $(ps -fe | grep 'ssh -f -D 2001 {username}@{username}.com -p 7822 -N' | grep -v grep | awk '{print $2}') ]]; then
kill $(ps -fe | grep 'ssh -f -D 2001 {username}@{username}.com -p 7822 -N' | grep -v grep | awk '{print $2}')
ssh -f -D 2001 {username}@{username}.com -p 7822 -N
else
ssh -f -D 2001 {username}@{domain}.com -p 7822 -N
fi
@mmoscosa
mmoscosa / database selection
Last active October 11, 2015 19:08
Select Database depending on environment, CakePHP
<?php
/**
* Automatically configure database connection.
*/
public function __construct() {
$environment = Configure::read('environment');
$operatingSystem = (DS === '/') ? 'Linux' : 'Windows';
if ($environment === 'development') {
$this->default = $this->development;
} else {