Skip to content

Instantly share code, notes, and snippets.

View resourcemode's full-sized avatar
🏠
Working from home

Michael Favila resourcemode

🏠
Working from home
View GitHub Profile
@resourcemode
resourcemode / notes
Last active August 29, 2015 14:01
stackoverflow useful notes
#sample website:
http://www.arte-charpentier.com/en/
http://www.maserati.us/maserati/us/en/index.html
http://absolutetravel.com/
http://echoaventura.com/page.php#!/8-12am/south-elevation-view
http://acollective.com.sg/
http://www.blackboxdesign.com.au/
http://www.bevisionare.com/
http://zozoui.com/accordion/
<?php
/**
* The DataUri class provides a convenient way to access and construct
* data URIs, but should not be relied upon for enforcing RFC 2397 standards.
*
* This class will not:
* - Validate the media-type provided/parsed
* - Validate the encoded data provided/parsed
*
* @link http://www.flyingtophat.co.uk/blog/27/using-data-uris-in-php Examples
@resourcemode
resourcemode / vhost-config-apache
Created August 14, 2014 08:38
apigility apache vhost config
# apigility.com
Listen 127.0.0.1:9271
NameVirtualHost 127.0.0.1:9271
<VirtualHost 127.0.0.1:9271>
DocumentRoot "D:\EasyPHP\data\localweb\projects\apigility.com\www"
RewriteEngine off
<Location />
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
@resourcemode
resourcemode / osx .profile
Created January 6, 2015 02:06
easy way to restart nginx, fpm, mysql
# MacPorts Installer addition on 2014-12-05_at_17:01:26: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
alias mysql_start='sudo /opt/local/share/mysql55/support-files/mysql.server start'
alias mysql_stop='sudo /opt/local/share/mysql55/support-files/mysql.server stop'
export PATH=$PATH:/usr/local/mysql/bin
# nginx
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
@resourcemode
resourcemode / importmysql.sh
Last active August 18, 2016 02:20
import mysql
#!/bin/bash
FILES=/Users/IT/dumps/LocalDB/*
for f in $FILES
do
echo "Processing $f file..."
# take action on each file. $f store current file name
mysql -uDBUSER -hDBHOST --pDBPASSWORD DBNAME < $f
done
@resourcemode
resourcemode / nginx
Created August 25, 2016 09:49 — forked from pzorn/nginx
php-fpm and nginx init.d script
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
@resourcemode
resourcemode / port forwarding
Last active October 4, 2016 03:24
http port forwarding to access VM vagrant hosted applications
Access your local vagrantbox from your remote or other machine within the network.
Get the host machine IP and add it in the /etc/hosts of your server/computer that will access the vagrantbox.
E.g 10.9.6.91 yourdomain.dev
First step is to create this file 'http' in /etc/pf.anchors and add the data below:
rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/http"
Next step is to create this file 'pf-http.conf' in /etc and add the data below:
rdr-anchor "forwarding"
@resourcemode
resourcemode / delete-branch.sh
Created June 27, 2017 09:23
Delete git branches using sh script
#!/bin/sh
## declare an array variable
branches=("develop" "master")
repositoryPath="/Users/michael.favila/project/trading-platform"
## now loop through the above array
for i in "${branches[@]}"
do
echo "$repositoryPath ${i}"
@resourcemode
resourcemode / iterm2-solarized.md
Created November 20, 2018 12:47 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k