Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Martin Moscosa mmoscosa

💭
I may be slow to respond.
View GitHub Profile
View gist:8d63530d705341c870e669707be8e42d
### 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:
View gist:a662d12c60957a1444b74a6f0e9ad086
### 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:
View sublime config
{
"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":
View iTerm2 Snippets.md

##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 Jul 12, 2016
Atom Sync Settings for multiplatform syncing Automatic update by http://atom.io/packages/sync-settings
View init.coffee
# 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 Feb 21, 2014
Country Drop Down List for Web Forms: Source http://bit.ly/1jVR0rm
View Country Drop Down
<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 Dec 28, 2015
NGINX Default server config
View 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;
View bootstrap.php
<?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 Jan 21, 2013
Script to open a SSH proxy Tunneling using Socks
View sshProxy
#!/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 Oct 11, 2015
Select Database depending on environment, CakePHP
View database selection
<?php
/**
* Automatically configure database connection.
*/
public function __construct() {
$environment = Configure::read('environment');
$operatingSystem = (DS === '/') ? 'Linux' : 'Windows';
if ($environment === 'development') {
$this->default = $this->development;
} else {