Skip to content

Instantly share code, notes, and snippets.

View brrih's full-sized avatar

Brian Howard brrih

  • Seattle
  • 19:04 (UTC -07:00)
View GitHub Profile
@thoaster
thoaster / MAMP PRO 4 Trial Reset.md
Last active April 7, 2024 16:22
MAMP PRO 4 Trial Reset

MAMP PRO 4 Trial Reset

A simple script that resets latest MAMP PRO 4 trial validity, and keeps your data safe.

How to use

  • Copy the code into a file OR download the script and save it as reset_mamp4.sh
  • Open the Terminal app and write chmod +x then drag and drop the file on the Terminal. You should have something like chmod +x reset_mamp4.sh. Press Enter to run it.
  • Now, run the file itself by dragging and dropping it on the Terminal (something like reset_mamp4.sh) then pressing Enter.
  • Open MAMP PRO and check if you have 14 days left now.

Didn't work?

@michalochman
michalochman / gulpfile.js
Last active May 19, 2021 22:11
gulp.js: babelify + browserify + sourcemaps
/* jshint strict: false */
/* globals require, console */
var gulp = require('gulp');
var exit = require('gulp-exit');
var browserify = require('browserify');
var watchify = require('watchify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
@faun
faun / smb_fs_automount.sh
Last active July 8, 2020 10:50
Script to mount remote SMB volume using password stored in Mac OS keychain without needing admin or sudo priveliges
#!/usr/bin/env bash
# Fetch the password from the keychain if it exists
PASSWORD_ENTERED=false
ACCOUNT_NAME='login'
SERVICE_NAME='mount_volume'
PASSWORD=$(
security 2> /dev/null \
find-generic-password -w \
-a $ACCOUNT_NAME \
@jbutko
jbutko / gulpfile.js
Last active February 13, 2019 06:25
BrowserSync + Gulp.js: Simple webServer + liveReload + watching CSS, HTML and SASS files
/**
* This example:
* Uses the built-in BrowserSync server for HTML files
* Watches & compiles SASS files
* Watches & injects CSS files
*
* More details: http://www.browsersync.io/docs/gulp/
*
* Install:
* npm install browser-sync gulp gulp-sass --save-dev
@robdecker
robdecker / any.php
Last active November 11, 2020 01:13
[Create custom breadcrumbs for views] #d7
/**
* Implements hook_views_pre_render().
*/
function HOOK_views_pre_render(&$view) {
if ($view->name == 'NAME') {
$breadcrumb = array();
$breadcrumb[] = l(t('Home'), '<front>');
$breadcrumb[] = l(drupal_get_title(), current_path());
drupal_set_breadcrumb($breadcrumb);
}
@mikaelbr
mikaelbr / gulpfile.js
Created January 14, 2014 20:24
Example gulpfile for complete set-up.
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var less = require('gulp-less');
var refresh = require('gulp-livereload');
var lr = require('tiny-lr');
var server = lr();
var minifyCSS = require('gulp-minify-css');
var embedlr = require('gulp-embedlr');
@terkel
terkel / _decimal.scss
Last active June 17, 2024 14:07
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
@lsauer
lsauer / gist:2757250
Last active October 10, 2022 03:06
JavaScript : within a string, count the number of occurances of a character / character counting and string-position
//www.lsauer.com 2012
//Answer to:
//http://stackoverflow.com/questions/881085/count-the-number-of-occurances-of-a-character-in-a-string-in-javascript/10671743#10671743
//There are at least four ways. The best option, which should also be the fastest -owing to the native RegEx engine -, is placed at the top. //jsperf.com is currently down, otherwise I would provide you with performance statistics.
#1.
("this is foo bar".match(/o/g)||[]).length
//>2
#2.
"this is foo bar".split("o").length-1