These are the most useful Regular Expressions that I find myself using on a regular basis
Test to see if a string is a valid website address or not.
ls -1 /usr/local/Library/LinkedKegs | while read line; do echo $line; brew unlink $line; brew link --force $line; done | |
brew list -1 | while read line; do brew unlink $line; brew link $line; done |
/* | |
* This script will look for all images on a page and prevent right clicking on an image. | |
*/ | |
const images = document.getElementsByTagName('img'); | |
for(var i = 0; i < images.length; i++) { | |
images[i].addEventListener('contextmenu', event => event.preventDefault()); | |
} | |
// Note: I threw this script together as requested by a subscriber. I personally don't recommend doing |
# | |
# REQUIRES: | |
# - server (the forge server instance) | |
# - event (the forge event instance) | |
# - sudo_password (random password for sudo) | |
# - db_password (random password for database user) | |
# - callback (the callback URL) | |
# |
_.mixin({ | |
chunks: function(arr, size) { | |
var len = arr.length, | |
chunk_len = Math.ceil(len/size), | |
chunks = []; | |
for (var i = 0; i < chunk_len; i++) { | |
chunks.push(arr.slice(i*size, (i+1)*size)); | |
} | |
return chunks; | |
} |
import Vue from 'vue/dist/vue.esm' | |
import TurbolinksAdapter from 'vue-turbolinks' | |
import VueResource from 'vue-resource' | |
Vue.use(VueResource) | |
document.addEventListener('turbolinks:load', () => { | |
Vue.http.headers.common['X-CSRF-Token'] = document.querySelector('meta[name="csrf-token"]').getAttribute('content') | |
var Profiles = Vue.extend({ |
/* | |
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
It will generate several classes such as: | |
.mr-10 which gives margin 10 pixels. | |
.pb-5 gives PADDING 5 pixels | |
The first letter is "m" or "p" for MARGIN or PADDING | |
Second letter is "t", "b", "l", or "r" for TOP, BOTTOM, LEFT, or RIGHT | |
Third letter is the number of spacing in pixels. Adjust the amounts generated by editing the $spaceamounts variable below. |
Between [company name]
And [customer name].
We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.
Install Supervisor with sudo apt-get install supervisor
in Unix or brew install supervisor
in Mac OSX. Ensure it's started with sudo service supervisor restart
in Unix or brew services start supervisor
in Mac OSX.
In Unix in /etc/supervisord/conf.d/
create a .conf
file. In this example, laravel_queue.conf
(contents below). Give it execute permissions: chmod +x laravel_queue.conf
.
In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini
and in /usr/local/etc/supervisor.d/
create a .conf
file. In this example, laravel_queue.conf
(contents below). Give it execute permissions: chmod +x laravel_queue.conf
.
This file points at /usr/local/bin/run_queue.sh
, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh
.
Now update Supervisor with: sudo supervisorctl reread
in Unix and with: brew services restart supervisor
in MAc OSX . And start using those changes with: sudo supervisorctl update
.