This file contains 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
'use strict'; | |
const path = require('path') | |
const redirect = new_url => { | |
return { | |
status: '301', | |
statusDescription: 'Moved Permanently', | |
headers: { | |
location: [{ |
This file contains 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 https = require('https'); | |
const { CODESHIP_KEY, PROJECT_ID } = process.env; | |
const getBuilds = () => { | |
console.time('Fetching builds...'); | |
return new Promise((resolve, reject) => { | |
const host = 'codeship.com'; | |
const path = `/api/v1/projects/${PROJECT_ID}.json?api_key=${CODESHIP_KEY}`; | |
const options = { |
This file contains 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
# AWS Lambda Node.js deploy script | |
# @author Nabil Freeman <nabil@instafork.com> (https://github.com/nabilfreeman) | |
# *************************************** | |
# Environment variables required: | |
# AWS_ACCESS_KEY_ID=XXXXXXX | |
# AWS_SECRET_ACCESS_KEY=XXXXXXXX | |
# AWS_DEFAULT_REGION=eu-west-1 | |
# LAMBDA_FUNCTION_NAME=asdfghjkl |
This file contains 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
// AWS settings | |
public static function AWS_ACCESS_KEY_ID(){ | |
if(isset($_SERVER['AWS_ACCESS_KEY_ID'])){ | |
return $_SERVER['AWS_ACCESS_KEY_ID']; | |
} else { | |
return "XXX"; | |
} | |
} | |
public static function AWS_SECRET_KEY(){ | |
if(isset($_SERVER['AWS_SECRET_KEY'])){ |
This file contains 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
discoveryd is completely fucked in some way in Yosemite. It randomly starts using up 100% CPU and doesn't stop until you reboot or the laptop dies. | |
To fix the CPU/battery rape, you need to restart the service with these shell commands: | |
launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist | |
launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist | |
No sudo required. The problem will randomly return after restarting the service, so I configured launchd to run a shell script with those commands in it every hour. | |
No more problems, and it appears to have caused no side effects. |
This file contains 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
I had a problem with a site my widget was embedded on. | |
var el = document.createElement("div"); | |
el instanceof Element; | |
>>> false | |
wat... | |
every other site on the planet returned true. | |
It turns out the culprit was Mootools v1.11. |
NewerOlder