This file contains hidden or 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
| const isEqual = (a, b) => { | |
| const aKeys = Object.keys(a); | |
| if (aKeys.length !== Object.keys(b).length) { | |
| return false; | |
| } | |
| return aKeys.every( | |
| (k) => Object.prototype.hasOwnProperty.call(b, k) | |
| && a[k] === b[k], |
This file contains hidden or 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 | |
| USER=${1:-sebble} | |
| STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-) | |
| PAGES=$((658/100+1)) | |
| echo You have $STARS starred repositories. | |
| echo |
This file contains hidden or 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
| // How to use: | |
| // 1. Open "Script Editor" (requires OS X 10.10 Yosemite) | |
| // 2. Change the language from "AppleScript" to "JavaScript" | |
| // 3. Paste the code below and replace the safari example. | |
| // | |
| // More info: | |
| // https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html | |
| var sys_events = Application("System Events"); |
This file contains hidden or 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
| <?php | |
| $formKey = "blahblahblah"; // ENTER YOUR OWN VALUE - you can find your formkey by going to your live form in the spreadsheet and copying the value from the url | |
| $redirectUrl = "http://www.yoursite.com/thank-you/"; // ENTER YOUR OWN VALUE - the url you want to direct people to after they fill in the form | |
| $dataUrl = "https://spreadsheets0.google.com/spreadsheet/pub?blahblahblah&single=true&gid=1&output=csv"; // ENTER YOUR OWN VALUE - for parallel sessions you need to publish the public sheet via the share settings. This url is not published in the live webpage source | |
| // function to get external webpages/data | |
| function getData($url){ | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
This file contains hidden or 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
| function randomDate(start, end) { | |
| return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime())); | |
| } | |
| console.log(randomDate(new Date(2012, 0, 1), new Date())); |