Skip to content

Instantly share code, notes, and snippets.

View AndreasPizsa's full-sized avatar
⌨️

Andreas Pizsa AndreasPizsa

⌨️
View GitHub Profile
@AndreasPizsa
AndreasPizsa / parseWindowLocationQuery.js
Last active November 4, 2018 16:46
Parse URL query string in JavaScript
/**
* sets window.location.query, which is a hash with all parameters
* param names are all lowercase
* reference as window.location.query.myparameter
*/
(function parseWindowLocationQuery(w){
var d=decodeURIComponent,
q=w.location.query=w.location.query||{},
pairs=w.location.search.substr(1).split('&'),
i;
[
"<script type='text/javascript'>console.log('hello')</script>",
"https://gist.githubusercontent.com/AndreasPizsa/fa7433b5af9c7fe7bd73710a38617d56/raw/script.js",
"https://obamaself.com"
]
{
"foo": "bar!"
}
@AndreasPizsa
AndreasPizsa / HTTP Errors
Created December 8, 2014 16:03
List of Restify HTTP and REST Error Exceptions
100 restify.errors.ContinueError
101 restify.errors.SwitchingProtocolsError
102 restify.errors.ProcessingError
200 restify.errors.OKError
201 restify.errors.CreatedError
202 restify.errors.AcceptedError
203 restify.errors.Non-AuthoritativeInformationError
204 restify.errors.NoContentError
205 restify.errors.ResetContentError
206 restify.errors.PartialContentError
<!DOCTYPE html>
<html>
<head>
<title>{{ results[0].name.first }} >{{ results[0].name.last }}</title>
</head>
<body>
<h1>{{ results[0].name.first }} {{ results[0].name.last }}</h1>
<img src="{{ results[0].picture.large}}">
</body>
</html>
@AndreasPizsa
AndreasPizsa / gist:4eea7957553ed661c4df
Created November 7, 2014 15:19
Fix Bluetooth Audio hickups on Mac OS X
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 48
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 53
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
defaults write com.apple.BluetoothAudioAgent "Stream – Flush Ring on Packet Drop (editable)" 30
defaults write com.apple.BluetoothAudioAgent "Stream – Max Outstanding Packets (editable)" 15
defaults write com.apple.BluetoothAudioAgent "Stream Resume Delay" "0.75"