Portable
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
// http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands | |
Raphael.fn.arc = function(startX, startY, endX, endY, radius1, radius2, angle) { | |
var arcSVG = [radius1, radius2, angle, 0, 1, endX, endY].join(' '); | |
return this.path('M'+startX+' '+startY + " a " + arcSVG); | |
}; | |
Raphael.fn.circularArc = function(centerX, centerY, radius, startAngle, endAngle) { | |
var startX = centerX+radius*Math.cos(startAngle*Math.PI/180); | |
var startY = centerY+radius*Math.sin(startAngle*Math.PI/180); | |
var endX = centerX+radius*Math.cos(endAngle*Math.PI/180); |
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 | |
## | |
# Script created by David Lewis (highwayoflife@gmail.com) for PyroCMS | |
# This script will rename an existing (core) CMS module and duplicate it into the | |
# addons/shared_addons/modules directory, while renaming it and all file contents to | |
# match | |
# | |
# Usage: ./rename_module.sh "old_module" "new_module" | |
# |
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 | |
## | |
# Modified version of https://gist.github.com/3680107 | |
# | |
# Tested for use on Mac OS X 10.7.5 with Bash 3.2.48(1)-release | |
# | |
# Old module needs to be in system/cms/modules and a single word (Ex: blogs not site_blogs) | |
## |
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
# enable ES6 | |
parserOptions: | |
ecmaVersion: 6 | |
sourceType: "module" | |
ecmaFeatures: | |
jsx: true # enable React's JSX | |
# register plugins | |
plugins: | |
- meteor |
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
/* | |
Assuming you have an SQL file (or string) you want to run as part of the migration, which has a number of statements... | |
CI migration only allows you to run one statement at a time. If the SQL is generated, it's annoying to split it up and create separate statements. | |
This small script splits the statements allowing you to run them all in one go. | |
*/ | |
$sqls = explode(';', $sql); | |
array_pop($sqls); | |
foreach($sqls as $statement){ |
- Go to digitalocean.com and hit Create Droplet.
- Name your droplet, select size and region.
- Select ubuntu distribution and lamp application.
- Click Create droplet.
- You will receive an email with ip address and user credentials.
- Download putty from: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- Open putty.
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
// Accumulators | |
// ============================================================================= | |
// | |
// A tiny library for reactive programming that offers blazing fast generic | |
// collection manipulation, asyncronous flow control and the ability to | |
// represent infinitely large collections. | |
// | |
// Copyright Gordon Brander, 2013. Released under the terms of the [MIT license](http://opensource.org/licenses/MIT). | |
// | |
// Background: |
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
/** | |
* Save file splitting it by chunks of 9M | |
* @param {Blob} FileBlob blob data to save | |
* @param {Folder} folder destination folder | |
* @param {Number} chunkSize | |
* @return {String} | |
*/ | |
function saveFileByChunks(fileBlob, folder, chunkSize) { | |
var | |
fileName = new Date().getTime(), |
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
docker.image('cloudbees/java-build-tools:0.0.6').inside { | |
sshagent(['github-ssh-credentials']) { | |
sh """ | |
git version | |
git config --local user.email \\"cleclerc@cloudbees.com\\" | |
git config --local user.name \\"Cyrille Le Clerc\\" | |
git clone git@github.com:cyrille-leclerc/a-test-repo.git | |
date &> now.txt |
OlderNewer