Skip to content

Instantly share code, notes, and snippets.

@the55
the55 / raphael.arcs.js
Created February 5, 2011 18:26
2 raphael arc objects
// 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);
@HighwayofLife
HighwayofLife / rename_module.sh
Created September 8, 2012 21:57
Rename/Duplicate PyroCMS Module Bash Script
#!/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"
#
@chadwithuhc
chadwithuhc / rename_module.sh
Created October 24, 2012 21:31 — forked from HighwayofLife/rename_module.sh
Rename/Duplicate PyroCMS Module Bash Script
#!/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)
##
@dferber90
dferber90 / .eslintrc.yml
Last active June 21, 2019 13:27
Example setup of ESLint-plugin-Meteor with AirBnB's code style
# enable ES6
parserOptions:
ecmaVersion: 6
sourceType: "module"
ecmaFeatures:
jsx: true # enable React's JSX
# register plugins
plugins:
- meteor
@Relequestual
Relequestual / migrations.php
Created November 16, 2012 16:09
Run multiple sql queries with CodeIgniter migrations
/*
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){
@vutran
vutran / Apps.md
Last active February 25, 2020 20:36
node, npm, git, cmder, and other nifty portable apps (for Windows)
@alamkanak
alamkanak / gist:771ffa63b159c5f0b936
Last active December 1, 2020 23:24
How I set up a server in DigitalOcean for Laravel

Create a droplet

  1. Go to digitalocean.com and hit Create Droplet.
  2. Name your droplet, select size and region.
  3. Select ubuntu distribution and lamp application.
  4. Click Create droplet.
  5. You will receive an email with ip address and user credentials.

Log in with putty

  1. Download putty from: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
  2. Open putty.
@gordonbrander
gordonbrander / accumulators.js
Last active December 26, 2020 08:26
Accumulators -- a tiny JavaScript implementation of Clojure's reducers.
// 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:
@tsertkov
tsertkov / Code.js
Created February 17, 2015 15:39
Google Apps Script save fileBlob splitting it by chunks of given size
/**
* 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(),
@cyrille-leclerc
cyrille-leclerc / pipeline.groovy
Last active March 9, 2022 23:41
Escape character & quotes in Jenkins Pipeline
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