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/bash | |
# Install NodeJS via NVM | |
sudo apt-get install -y git-core curl | |
curl https://raw.githubusercontent.com/creationix/nvm/v0.3.0/install.sh | bash | |
echo "source /home/vagrant/.nvm/nvm.sh" >> /home/vagrant/.profile | |
source /home/vagrant/.profile | |
nvm install 0.12 | |
nvm alias default 0.12 |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "private_network", ip: "192.168.31.17" | |
config.vm.hostname = "rails.demo" | |
config.vm.provider "virtualbox" do |vb| |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "debian/jessie64" | |
config.vm.network "private_network", ip: "10.0.0.48" | |
config.vm.hostname = "drupal8.local" | |
config.vm.provider "virtualbox" do |vb| | |
# Display the VirtualBox GUI when booting the machine |
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 | |
return [ | |
[ "Angola", "AO" ], | |
[ "Antigua and Barbuda", "AG" ], | |
[ "Aruba", "AW" ], | |
[ "Bahamas", "BS" ], | |
[ "Belize", "BZ" ], | |
[ "Benin", "BJ" ], | |
[ "Botswana", "BW" ], |
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
// Drop this directly into the console | |
jQuery('.sortable-image img, .sortable-image').css({width:'auto',height:'auto'}) | |
jQuery('.sortable-image img').each( function(e,elem) { | |
var fixedImg = jQuery(this).attr('src').replace('s.png','.png'); | |
jQuery(this).attr( 'src', fixedImg ); | |
}); |
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
/* | |
* so I decided to check out freecodecamp today, just to see how it was | |
* | |
* It's okay, but I have to question the value of learning to write a palindrome checker, that to my mind is not much use... | |
* Here was my punt at it (it passed, I just don't love the look of it) | |
*/ | |
function palindrome(str) { | |
// Good luck! | |
str = str.toLowerCase().replace(/[^a-z0-9]/g, ''); |
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 | |
function offsetsIn(string $haystack, string $needle, $cs=true) : array { | |
$offset = false; | |
$pos = 0; | |
$out = []; | |
$func = $cs ? '\strpos' : '\stripos'; | |
while (strlen($haystack) > 0 && ($pos === 0 || $offset !== false)) { | |
if($offset !== false) { | |
$out[] = $offset; |
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/bash | |
# | |
# This version uses September 2017 august stretch image, please use this image | |
# | |
if [ "$EUID" -ne 0 ] | |
then echo "Must be root" | |
exit | |
fi |
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
FROM ubuntu:16.04 | |
RUN apt-get -y update && apt-get install -y php7.0-fpm php7.0-cli php7.0-curl php7.0-gd php7.0-intl php7.0-zip php7.0-pgsql build-essential git gcc make re2c libpcre3-dev php7.0-dev curl | |
RUN curl -sS http://getcomposer.org/installer | php | |
RUN mv composer.phar /usr/local/bin/composer | |
RUN composer global require "phalcon/zephir:dev-master" | |
RUN mkdir -p /opt/www |
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/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Must be root" | |
exit | |
fi | |
apt-get update -y | |
apt-get upgrade -y | |
apt-get dist-upgrade -y |