Skip to content

Instantly share code, notes, and snippets.

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

mcorridor marlocorridor

🏠
Working from home
View GitHub Profile
@marlocorridor
marlocorridor / spark MD5 usage.js
Created September 3, 2015 04:39
Deferred Implmentation of spark md5 js library.
function getFileMd5 ( file ) {
var dfd = jQuery.Deferred();
/**
* reference:
* https://github.com/satazor/SparkMD5
*/
var blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice,
chunkSize = 2097152, // Read in chunks of 2MB
chunks = Math.ceil(file.size / chunkSize),
currentChunk = 0,
@marlocorridor
marlocorridor / preloader.js
Last active May 17, 2016 08:04
Loads the assets to be cached by the browser.
// depends on jQuery
var PreloaderClass = function (urls) {
// holds the URLs passed
this.urls = urls;
// base loading
this.loadUrl = function ( url ) {
var supported, deferredLoading, xhr;
rhc app-deploy master --app <domain/appname>
rhc env list -a <domain/appname>
rhc port-forward -a <domain/appname>
#"recover" jenkins account
cat jenkins/env/JENKINS_USERNAME
cat jenkins/env/JENKINS_PASSWORD
@marlocorridor
marlocorridor / callout.scss
Last active November 9, 2016 03:43 — forked from mattsimpson/docs style (bootstrap)
This is the Twitter Bootstrap documentation's callout css. Looks nice.
// Brands
$brand-primary: #3097D1;
$brand-info: #8eb4cb;
$brand-success: #2ab27b;
$brand-warning: #cbb956;
$brand-danger: #bf5329;
.bs-callout {
padding: 20px;
margin: 20px 0;
@marlocorridor
marlocorridor / LaravelMigration.md
Last active December 15, 2016 11:34
Check if index exist

Laravel Migration Check Foreign Key if exist tested on laravel 5.0

	 /**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
@marlocorridor
marlocorridor / laravel_seeder.sh
Last active December 15, 2016 14:06
Make laravel seeder work properly - solves class not found
# To work something like
# php .\artisan db:seed --class=UsersTableSeeder
# where `UsersTableSeeder` is a newly created class on seeder file
# you need to execute this first
composer dump-autoload
# Reference :)
#http://laravel.io/forum/01-31-2015-laravel5-seeder-reflectionexception-class-tableseeder-does-not-exist-in-illuminatecontainercontainerphp776
# You should never forget, even when it sounds dummy to dump the autoload files with the command "composer dump-autoload" to make the seeders work properly.
(function () {
// Image decoders (for web workers)
dwv.image.decoderScripts = dicom_extenstions;
// base function to get elements
dwv.gui.getElement = dwv.gui.base.getElement;
dwv.gui.displayProgress = function (percent) {};
// create the dwv app
var app = new dwv.App();
@marlocorridor
marlocorridor / cloudflareWhitelistUpdate.php
Last active April 23, 2018 09:33 — forked from ostark/cloudflareWhitelistUpdate.php
Updates the .htaccess with the recent ClouldFlare IPs
<?php
# Exec during deployment
# php cloudflareWhitelistUpdate.php public/.htaccess
$srcUrls = [
'https://www.cloudflare.com/ips-v4',
'https://www.cloudflare.com/ips-v6'
];
$htacessFile = $argv[1] ?? '.htaccess';
@marlocorridor
marlocorridor / pyramid.js
Last active May 3, 2018 04:35
Pyramid test
function space_front(size, n) {
return size - n;
}
function space_mid(n) {
return (2 * n) - 3;
}
function is_top(n) {
return n > 1;
#!/bin/bash
# Creator: Phil Cook
# Email: phil@phil-cook.com
# Twitter: @p_cook
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.6","7.0","7.1","7.2")
php_array=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
valet_support_php_version_array=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
php_installed_array=()