This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugify(string){ | |
const a = 'àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;' | |
const b = 'aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz------' | |
const p = new RegExp(a.split('').join('|'), 'g') | |
return string.toString().toLowerCase() | |
.replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi, 'a') | |
.replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi, 'e') | |
.replace(/i|í|ì|ỉ|ĩ|ị/gi, 'i') | |
.replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi, 'o') | |
.replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi, 'u') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin generate($prefix, $property) { | |
// List of sizes to generate for each | |
$sizes: [0, 0.25, 0.5, 1, 1.5, 3]; | |
// Spacing to multiply the sizes by | |
$spacing: 1rem; | |
// Loop through all of the sizes(we use @for rather than @each, as we want access to the index) | |
@for $i from 1 through length($sizes) { | |
// Get the size for the current index | |
$size: nth($sizes, $i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The intent of this script is for posting filtered Gmail messages to Slack. | |
This script could be used on its own with manually-marked messages, but it | |
is most useful it when combined with a Gmail filter. The script assumes that | |
target messages have had a specific label set on them and have been starred. | |
The Apps Script can then be set to run periodically. | |
2015/02 cmyers, rush | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var totalOrders = 0; | |
var totalSpent = 0; | |
var totalShippingSpent = 0; | |
var pulling = true; | |
var offset = 0; | |
function getStatistics() { | |
var orders = []; | |
var xhttp = new XMLHttpRequest(); | |
xhttp.onreadystatechange = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Vinkla\Hashids\HashidsManager; | |
/** | |
* Bind a model to a route based on the hash of | |
* its id (or other specified key). | |
* |
HomeBrew is a package manager for OSX. Brew install missing stuff so easy…
- Install Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
RVM: is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.
- Install GPG keys:
brew install gnupg
gpg --keyserver hkp://51.38.91.189 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
- Install RVM:
\curl -sSL https://get.rvm.io | bash -s stable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change to the project directory | |
cd /home/forge/domain.com | |
# Turn on maintenance mode | |
php artisan down | |
# Pull the latest changes from the git repository | |
git pull origin master | |
# Install/update composer dependecies |