- Install the operating system
- Install the service packs
- Apply updates from wsus offline
- Apply apps from ninite
- Apply third-party apps
- License keys should all be found/kept in lastpass
- Make a system image so you can do this quickly next time. Use Acronis TrueImage or Paragon Backup and Restore
This file contains hidden or 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
-- Modified from: http://stackoverflow.com/a/14248038/956779 | |
-- Add a BEFORE INSERT constraint that only allows values between 1 and 5 | |
DELIMITER $$ | |
CREATE TRIGGER `test_before_insert` BEFORE INSERT ON cheese_shop.items | |
FOR EACH ROW | |
BEGIN | |
IF (NEW.ratings > 5 OR NEW.ratings < 1) THEN | |
SIGNAL SQLSTATE '12345' | |
SET MESSAGE_TEXT = 'check constraint on items.ratings failed'; | |
END IF; |
This file contains hidden or 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
// if you try this in javascript: | |
// 10.2 * 100 | |
// you get this: | |
// 1019.9999999999999 | |
/** Safely scale a number. Just a hacky little demo. | |
* @param {string} numberAsString the number you want to scale e.g. 10.987654 | |
* @param {number} multipleOfTenAsNumber the number you want to scale by e.g. 1000 | |
* @returns {safeScale.result} the safely scaled number e.g. 10987.654 | |
*/ | |
function safeScale(numberAsString, multipleOfTenAsNumber) { |
This file contains hidden or 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 meteor_root = Npm.require('fs').realpathSync(process.cwd() + '/../'); | |
var application_root = Npm.require('fs').realpathSync(meteor_root + '/../'); | |
// if running on dev mode | |
var fs = Npm.require('fs'); | |
if (Npm.require('path').basename(fs.realpathSync(meteor_root + '/../../../')) == '.meteor') { | |
application_root = fs.realpathSync(meteor_root + '/../../../../'); | |
} | |
var assets_folder = meteor_root + '/server/assets/'; |
This file contains hidden or 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
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install apache2 mysql-client mysql-server php5 | |
sudo apt-get install graphviz aspell php5-pspell php5-curl php5-gd php5-intl php5-mysql php5-xmlrpc php5-ldap clamav | |
sudo service apache2 restart | |
sudo apt-get install git-core | |
cd /opt | |
sudo git clone git://git.moodle.org/moodle.git | |
cd moodle/ | |
sudo git branch --track MOODLE_28_STABLE |
This file contains hidden or 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 | |
# Run this from the meteor application folder. It's assumed that the git root is somewhere | |
# ABOVE the meteor application folder. If your meteor application root *is* the git root, | |
# review this code very carefully as I've not tested it in such cases. | |
# | |
# It downloads all meteor cordova tarball and https plugins, and registers them | |
# with the npm registry. I use this with a private registry (sinopia). | |
# It then updates the meteor cordova plugin registry with a reference to the npm registry. | |
meteordir="`pwd`" | |
destfoldername="cordova-plugins" |
This file contains hidden or 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
#!/usr/bin/env bash | |
infile=$1 | |
if [ ! -f $infile ]; then | |
echo specify a filename as the first parameter. | |
exit 1; | |
fi | |
tempdir=$(mktemp --directory --suffix=.iconset --tmpdir=`pwd`) |
- A screenshot with the correct aspect ratio
- A device frame PNG with a transparent area where the screenshot will be placed See Facebook's Device Art
- GraphicsMagick / ImageMagick
- That's it.
This file contains hidden or 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
#!/usr/bin/env bash | |
# get the full path for the current dir | |
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
###### prompt for values | |
# get the new app name | |
read -p "Enter your new app name [Foo App]: " NEW_APP_NAME | |
NEW_APP_NAME=${NEW_APP_NAME:-"Foo App"} |
OlderNewer