Skip to content

Instantly share code, notes, and snippets.

Working from home

mcorridor marlocorridor

View GitHub Profile
marlocorridor / gist:c4d8417f2fc58c3fb866e0a6f94354fb
Last active Jun 19, 2018 — forked from jordelver/gist:3139365
How to write an image file to an SD card under Mac OS X (for Raspberry Pi)
View gist:c4d8417f2fc58c3fb866e0a6f94354fb

Find the SD card device

In this case, the SD card is /dev/disk4. DO NOT get this wrong or you may destroy all the data on the wrong disk/card/drive.

diskutil list

   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *160.0 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
# Creator: Phil Cook
# Email:
# Twitter: @p_cook
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
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")
View pyramid.js
function space_front(size, n) {
return size - n;
function space_mid(n) {
return (2 * n) - 3;
function is_top(n) {
return n > 1;
marlocorridor / cloudflareWhitelistUpdate.php
Last active Apr 23, 2018 — forked from ostark/cloudflareWhitelistUpdate.php
Updates the .htaccess with the recent ClouldFlare IPs
View cloudflareWhitelistUpdate.php
# Exec during deployment
# php cloudflareWhitelistUpdate.php public/.htaccess
$srcUrls = [
$htacessFile = $argv[1] ?? '.htaccess';
View dwv-viewer.js
(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 /
Last active Dec 15, 2016
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 :)
# 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.
marlocorridor /
Last active Dec 15, 2016
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 / callout.scss
Last active Nov 9, 2016 — forked from mattsimpson/docs style (bootstrap)
This is the Twitter Bootstrap documentation's callout css. Looks nice.
View callout.scss
// Brands
$brand-primary: #3097D1;
$brand-info: #8eb4cb;
$brand-success: #2ab27b;
$brand-warning: #cbb956;
$brand-danger: #bf5329;
.bs-callout {
padding: 20px;
margin: 20px 0;
View openshift useful
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 / preloader.js
Last active May 17, 2016
Loads the assets to be cached by the browser.
View preloader.js
// depends on jQuery
var PreloaderClass = function (urls) {
// holds the URLs passed
this.urls = urls;
// base loading
this.loadUrl = function ( url ) {
var supported, deferredLoading, xhr;
You can’t perform that action at this time.