Skip to content

Instantly share code, notes, and snippets.

View tristanjahier's full-sized avatar

Tristan Jahier tristanjahier

View GitHub Profile
@tristanjahier
tristanjahier / change_case.coffee
Created March 22, 2017 16:08
Simple functions to change the case of a string
toSpaceCase = (str) ->
str.replace(/[\W_]+(.|$)/g, (x, y) -> " #{y ? ''}").trim()
.replace(/([a-z])([A-Z])/g, '$1 $2')
.replace(/\b([A-Z]+)([A-Z])([a-z])/, '$1 $2$3')
.toLowerCase()
toSnakeCase = (str) ->
toSpaceCase(str).replace(/\s/g, '_')
toCamelCase = (str) ->
@tristanjahier
tristanjahier / README.md
Last active May 7, 2019 05:26
A script to mass delete Twilio recordings using the Node.js helper library

Twilio recordings mass delete script

This is a Node.js script, written in CoffeeScript. Of course you'll need Node.js and NPM. Additionally, it requires the Coffee Script compiler/interpreter and the Twilio package.

npm install -g coffee-script
npm install twilio

Once everything is ready, you can run the script like that: