Skip to content

Instantly share code, notes, and snippets.

willdages / randomParse.js
Created November 24, 2012 14:19 — forked from adelevie/randomParse.rb
randomParse.rb in javascript
var query = new Parse.Query("Classname");
error: function(error) {
// Error counting objects
success: function(count) {
query.skip(Math.floor(Math.random() * (count - 1)));
error: function(error){
// Error getting object
willdages / javascript_object_logging.js
Last active December 14, 2015 16:39
Logging objects
var object = {
"a": 1,
"b": 2,
"c": 3
console.log('Look at this awesome object: ' + object);
// Outputs: Look at my awesome object: [object Object] -- totally opaque :(
console.log('Look at this awesome object: %o', object);
willdages / debugger.js
Last active December 14, 2015 16:48
Example of using the debugger statement in javascript code.
function add(input1, input2) {
return input1 + input2;
// Debugger is like using breakpoints in the source inspector,
// it pauses script execution and gives you access to local variables
// Run this example and type in 'input1' into the console when the page
// goes gray -- you have access to the scope where you put the 'debugger' statement!
willdages /
Last active September 3, 2020 21:46
Github Shell Script

GitHub Shell Script


Make sure the shell script is executable:

$ chmod +x /path/to/

In your ~/.bash_profile add an alias for the script:

willdages / slack-interactive-messages-api-gateway-mapping-template.vtl
Last active March 6, 2024 07:37
Slack's Interactive Messages endpoint reports a Content-Type of `application/x-www-form-urlencoded` but responds with something like looks like `payload=%7B%22actions%22%3A%5B%7B%22...`, which is encoded JSON inside the payload parameter, which takes the API Gateway VTL templates for a loop.
## The `substring(8)` returns the input with everything after "payload=" which is the only parameter passed in,
## everything else is encoded JSON inside that parameter.
#set ($encodedJSON = $input.body.substring(8))

Keybase proof

I hereby claim:

  • I am willdages on github.
  • I am willdages ( on keybase.
  • I have a public key ASBYiYMBfMxo4OhSOp6SKlEo6f_fT8GUFdM4JwFb6JpJIwo

To claim this, I am signing this object: