Skip to content

Instantly share code, notes, and snippets.

View MarcosBL's full-sized avatar
:octocat:
Github Advocate

MarcosBL MarcosBL

:octocat:
Github Advocate
View GitHub Profile

MacOS

Download from here:

http://d.pr/f/QE3d

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to:

@MarcosBL
MarcosBL / Koding Laravel Setup
Last active August 29, 2015 13:57
Koding Laravel Setup
# Set root
sudo su
# Install Composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
# Exit root
exit
@MarcosBL
MarcosBL / bash_progress_bar.sh
Created March 14, 2014 20:07
Bash progress bar
show_prog_bar() {
local c="$1" # Character to use to draw progress bar
local v=$2 # Percentage 0<= value <=100
local t=$3 # Text before
local pbl=50 # Progress bar length in characters
local r=`expr 100 / $pbl` # Ratio between percentage value and progress bar length
local p="$v%" # Percentage value to display in the middle of progress bar
local l=${#p} # Length of string to display
local pbs="" # Progress bar string
local k=`expr \( $pbl - $l \) / 2` # Position where to substitute in progress bar string
@MarcosBL
MarcosBL / flv2mp4
Created March 15, 2014 14:23
ffmpeg FLV to MP4 converter with progress bar
#!/bin/bash
####################################################################################
# ffmpeg flv2mp4 converter with progress indicator
# USAGE
# ./flv2mp4 VideoId
# Modify to your own needs
###################################################################################
SCRIPT=flv2mp4
LOG=/var/log/flv2mp4.log
@MarcosBL
MarcosBL / blocks.css
Created April 3, 2014 07:54
Visualise the size of each element on the page
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
### Keybase proof
I hereby claim:
* I am marcosbl on github.
* I am marcosbl (https://keybase.io/marcosbl) on keybase.
* I have a public key whose fingerprint is AF9D 3E27 B3D8 F49E B3AD A4DC 6022 F670 9EFA 042B
To claim this, I am signing this object:
@MarcosBL
MarcosBL / host_file
Created July 10, 2014 11:38
Nginx header write for serving fonts to firefox cross domain and avoid CORS
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
@MarcosBL
MarcosBL / .htaccess
Created July 10, 2014 11:40
Apache header write for serving fonts to firefox cross domain and avoid CORS
<FilesMatch ".(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
setInterval(function () {
var change = {};
$('#box span').each(function () {
var $this = $(this),
key = $this.css('background-color');
if (!(key in change)) {
change[key] = {
'element': $this,
@MarcosBL
MarcosBL / converting-mysql-database-contents-to-utf8
Created October 27, 2014 00:56
Converting MySQL Database Contents to UTF-8
# First create a dump of your MySQL database
mysqldump -u [user] -p database_name > database_name.sql
# Convert the data
iconv -f iso-8859-15 -t utf8 database_name.sql > database_name_iconv.sql
# Import the database
mysql -u [user] -p database_name < database_name_iconv.sql
# If you still have some specific characters that do not display