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 | |
use Illuminate\Console\Command; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Input\InputArgument; | |
class ClearBeanstalkdQueueCommand extends Command { | |
/** |
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
# Install Java | |
sudo apt-get install openjdk-7-jre-headless -y | |
# Download & install the Public Signing Key | |
wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add - | |
# Add the following to /etc/apt/sources.list | |
deb http://packages.elasticsearch.org/elasticsearch/1.3/debian stable main | |
# Update Aptitude |
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
(new \PragmaRX\Countries\Package\Countries()) | |
->all() | |
->keyBy('iso_3166_1_alpha2') | |
->filter(function ($value, $key) { | |
return (bool)strlen($key); | |
}) | |
->pluck('demonyms.eng.m') | |
->filter(function($name){ | |
return !empty($name); | |
}) |
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
#!/bin/sh | |
# size of swapfile in megabytes | |
swapsize=8000 | |
# does the swap file already exist? | |
grep -q "swapfile" /etc/fstab | |
# if not then create it | |
if [ $? -ne 0 ]; then |
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
# CONFIGURATION | |
#MYSQL credentials | |
MYSQL_USER="root" | |
MYSQL_PASS="" | |
# The user Apache runs as - e.g. _www, www-data | |
APACHE_RUNAS="_www" | |
#Bitbucket credentials |
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
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \ | |
*2^(8-i));if(k)printf("%0o ",k);print}' |
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
/** | |
* T'ipsum, a dead simple class for generating Yorkshire t'ipsum. | |
* | |
* Based on http://tlipsum.appspot.com/ by @tonyblundell. | |
*/ | |
class Tipsum { | |
/** | |
* The actual text | |
*/ |
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 Lukaswhite\Pagination; | |
use Illuminate\Pagination\Paginator; | |
class FoundationPresenter { | |
/** | |
* The paginator instance being rendered. | |
* | |
* @var \Illuminate\Pagination\Paginator |
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 | |
error_reporting(-1); | |
ini_set('display_errors', 'On'); | |
define('DRUPAL_ROOT', getcwd()); | |
require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
drupal_flush_all_caches(); | |
print 'All caches cleared'; |
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
require 'date' | |
module Jekyll | |
module OrdinalizedDate | |
def ordinalized_date(input) | |
d = input.strftime("%e") | |
input.strftime("%A ") + self.ordinalize(d.to_i) + input.strftime(" %B, %Y") | |
end | |
def ordinalize(number) | |
if (11..13).include?(number % 100) |
NewerOlder