Skip to content

Instantly share code, notes, and snippets.

View arcdev1's full-sized avatar

Bill Sourour arcdev1

  • Arcnovus
  • Ottawa, Canada
View GitHub Profile
var s = "some_string_to_change",
len= s.length,
i,
upped = false; // we will use this to make sure we don't double count a character
result = ""; // this is where we will store the result
for(i=0;i<len;i++) {
if(s[i] === "_") { // if we find an underscore
result += s[i+1].toUpperCase(); // add the next character, uppercased, to our result
upped = true; // make sure we don't add this character again
var s = "some_string_to_change",
len= s.length,
i,
upped = false;
result = "";
for(i=0;i<len;i++) {
if(s[i] === "_") {
result += s[i+1].toUpperCase();
upped = true;
@arcdev1
arcdev1 / deploy2parse.sh
Last active January 13, 2016 12:49
Deploy to Parse from Codeship
# Install the Parse Command Line Tool
export TMP_FILE=/tmp/parse.tmp
export latest=`curl -X GET https://api.parse.com/1/supported?version=latest|grep -Po '(\d.\d.\d)'`
export url="https://github.com/ParsePlatform/parse-cli/releases/download/release_${latest}/parse_linux"
curl --progress-bar --compressed -Lo ${TMP_FILE} ${url}
mv /tmp/parse.tmp ${HOME}/bin/parse
chmod 755 ${HOME}/bin/parse
# Avoid login prompt by using a Parse account key
# Note: Make sure you have created an account key at https://dashboard.parse.com/account/overview
/**
* This Gist has been modified to use a custom flag on the config object instead of an HTTP Header in order to
* indicate wether or not to specifically handle the error.
* THIS CODE IS UNTESTED!!
*/
//var HEADER_NAME = 'MyApp-Handle-Errors-Generically'; // We don't want to use Headers, we use a flag on the config object instead
var specificallyHandleInProgress = false;
angular.module('myApp').factory('RequestsErrorHandler', ['$q', function($q) {
/**
* Original code developed by Robert Nyman, http://www.robertnyman.com
* Code/licensing: http://code.google.com/p/getelementsbyclassname/
*
* Arcnovus modifications:
* - Tweaked code to pass JSLint validation (all vars declared together, no more assignment in expressions).
* - Added 'item' method to array returned in order to mimick nodeList
*/
(function (window, document) {
'use strict';