Skip to content

Instantly share code, notes, and snippets.

View nabilfreeman's full-sized avatar
🤗
hello wrold

Nabs nabilfreeman

🤗
hello wrold
View GitHub Profile
// 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'])){
@nabilfreeman
nabilfreeman / gist:7e82aa5ac4ef172d22c5
Created May 20, 2015 22:52
SOLVED: discoveryd eating up battery and CPU on Mac OS X Yosemite 10.10.3
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.
@nabilfreeman
nabilfreeman / gist:bd0d413993ddfc964c18
Created October 7, 2014 22:48
instanceof Element returns false
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.