Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

mcorridor marlocorridor

🏠
Working from home
Block or report user

Report or block marlocorridor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@marlocorridor
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

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *160.0 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
View sphp.sh
#!/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=()
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
marlocorridor / cloudflareWhitelistUpdate.php
Last active Apr 23, 2018 — forked from ostark/cloudflareWhitelistUpdate.php
Updates the .htaccess with the recent ClouldFlare IPs
View cloudflareWhitelistUpdate.php
<?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';
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
marlocorridor / laravel_seeder.sh
Last active Dec 15, 2016
Make laravel seeder work properly - solves class not found
View laravel_seeder.sh
# 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.
@marlocorridor
marlocorridor / LaravelMigration.md
Last active Dec 15, 2016
Check if index exist
View LaravelMigration.md

Laravel Migration Check Foreign Key if exist tested on laravel 5.0

	 /**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
@marlocorridor
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 commands.sh
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 / 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.