Skip to content

Instantly share code, notes, and snippets.

View redolent's full-sized avatar

Mark Stewart redolent

  • ScheduleTailor
  • Boise, ID
View GitHub Profile
@levivoelz
levivoelz / php_apache_homebrew.md
Last active January 9, 2020 08:57 — forked from DragonBe/php_apache_homebrew.md
Installation of Apache 2.4 and PHP 7.1 with Homebrew

Apache and PHP with Homebrew

The installation procedures

These installation procedures will set up your mac with PHP 7.2 and Apache 2.4.

Install Xcode command line tools (if not done yet)

xcode-select --install
@jarretmoses
jarretmoses / React Native Clear Cache
Last active March 11, 2024 10:20
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@bzz
bzz / install-parallel-centos-6.sh
Last active March 30, 2019 01:18
Install GNU Parallel on CentOS 6
#!/bin/bash
# Install parallel on CentOS 6.
# Assumes you are root. Prefix w/ sudo if not.
cd /etc/yum.repos.d/
#wget http://download.opensuse.org/repositories/home:tange/CentOS_CentOS-5/home:tange.repo
wget http://download.opensuse.org/repositories/home:/tange/CentOS_CentOS-6/home:tange.repo
yum install parallel
<?php
/**
* Translates a number to a short alhanumeric version
*
* Translated any number up to 9007199254740992
* to a shorter version in letters e.g.:
* 9007199254740989 --> PpQXn7COf
*
* specifiying the second argument true, it will
* translate back e.g.:
@strathmeyer
strathmeyer / gist:4990173
Created February 19, 2013 21:31
Improve OSX Bluetooth quality
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 48
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 53
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
defaults write com.apple.BluetoothAudioAgent "Stream - Flush Ring on Packet Drop (editable)" 30
defaults write com.apple.BluetoothAudioAgent "Stream - Max Outstanding Packets (editable)" 15
defaults write com.apple.BluetoothAudioAgent "Stream Resume Delay" "0.75"
@Integralist
Integralist / 1.abbreviate.js
Last active December 15, 2015 02:45
Was reading http://jspro.com/raw-javascript/intelligent-string-abbreviation/ and decided to try and clean up the example. I then made another version which separated specific functionality into individual functions. Finally I made a third variation which made dependencies external.
/**
* Shorten a string by a specified number of characters and end the string
* using either a user specified suffix or a default suffix.
* Ensures string is not abbreviated prematurely (e.g. half way through a word)
*
* @param {string} user specified string
* @param {number} the maximum allowed characters before abbreviating
* @param {string} the characters used to end the string
* @return {string} the abbreviated string
*/
@nikcub
nikcub / chrome.refresh.sh
Created October 31, 2011 03:05
Chrome Refresh
#!/bin/bash
# Chrome Refresh
#
# nik cubrilovic - nikcub.appspot.com
#
# Simple applescript browser reloader for Google Chrome. It will either open a
# new tab with the url passed in as an argument or refresh an existing tab.
#
# Link this up with watchr to auto-refresh browser windows when you save files
@vyatri
vyatri / MimeMailParser.class.php
Created April 24, 2011 09:06
This class allows you to receive and parse email in PHP efficiently and effortlessly.
<?php
require_once('attachment.class.php');
/**
* Fast Mime Mail parser Class using PHP's MailParse Extension
* @author gabe@fijiwebdesign.com
* @url http://www.fijiwebdesign.com/
* @license http://creativecommons.org/licenses/by-sa/3.0/us/
* @version $Id$
@lantrix
lantrix / IMStatus.scpt
Created January 3, 2011 12:55
Applescript to tell Adium, Skype and iChat to change their status simultaneously
-- IMStatus
-- version 2.0, Lantrix (http://techdebug.com)
-- idea conceived from script by Jason Kenison "theWebGuy" Blog at:
-- http://www.jasonkenison.com/blog.html?id=22
(*
Copyright (c) 2008, TechDebug.com
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@tim-smart
tim-smart / ctags definitions for Javascript
Created October 2, 2009 00:07
CTags Definitions for Javascript
--langdef=js
--langmap=js:.js
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\{/\5/,object/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\[/\5/,array/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[^"]'[^']*/\5/,string/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*(true|false)/\5/,boolean/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[0-9]+/\5/,number/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*.+([,;=]|$)/\5/,variable/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*[ \t]*([,;]|$)/\5/,variable/