Skip to content

Instantly share code, notes, and snippets.

Adrian Juszczak Juszczak

Block or report user

Report or block Juszczak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Juszczak / localstorage-safari-private-shim.js
Last active Aug 29, 2015
Don't let localStorage/sessionStorage setItem throw errors in Safari Private Browsing Mode
View localstorage-safari-private-shim.js
// Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem
// throw QuotaExceededError. We're going to detect this and just silently drop any calls to setItem
// to avoid the entire page breaking, without having to do a check at each usage of Storage.
if (typeof localStorage === 'object') {
try {
localStorage.setItem('localStorage', 1);
} catch (e) {
Storage.prototype._setItem = Storage.prototype.setItem;
Juszczak /
Created Jul 6, 2015
Add some generic CORS configuration to your CouchDB using curl. You can always change the configuration by simply going to and updating the values. However, these default options are good for getting up and running.
HOST=http://name:password@ # or whatever you got
curl -X PUT $HOST/_config/httpd/enable_cors -d '"true"'
curl -X PUT $HOST/_config/cors/origins -d '"*"'
curl -X PUT $HOST/_config/cors/credentials -d '"true"'
curl -X PUT $HOST/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT $HOST/_config/cors/headers -d '"accept, authorization, content-type, origin, referer, x-csrf-token"'
Juszczak /
Created Oct 26, 2015
Disable the Window Shadow on Screen Shots in Mac OS X
defaults write disable-shadow -bool true
killall SystemUIServer
Juszczak / s3copy-across-aws-accounts.js
Created Nov 18, 2015 — forked from raffi-minassian/s3copy-across-aws-accounts.js
Quick and dirty script to copy files in AWS S3 to an S3 bucket in another AWS account with Node.js.
View s3copy-across-aws-accounts.js
* This is a quick and dirty script for copying files in AWS S3 to other buckets.
* This is written so it can work across AWS accounts.
* You can hack in code to apply work or logic to each file.
* For each file, it downloads locally to a tmp file and then starts uploading as soon as possible
* and deletes the file immediately when the upload is done.
* Best way to use: Spin up a micro in EC2, install node.js,
* create a directory and install the dependencies with

Keybase proof

I hereby claim:

  • I am juszczak on github.
  • I am juszczak ( on keybase.
  • I have a public key ASDhgxSrsMgfIAUaa-q2s4hD_gtMUWmdOyo3lNlv9-a2zQo

To claim this, I am signing this object:

View gpg.asc
Version: GnuPG v2
Juszczak / converter.js
Last active Jun 1, 2017
dirty `.json` <-> `.properties` converter
View converter.js
const fs = require('fs')
const path = require('path')
const readJSON = fileName => JSON.parse(fs.readFileSync(path.resolve(process.cwd(), fileName), 'utf8'))
const toJSON = data => {
const output = {}
Juszczak / KeyCodes.ts
Created Jul 21, 2017
KeyboardEvent key codes enum
View KeyCodes.ts
export enum KeyCodes {
Backspace = 8,
Tab = 9,
Enter = 13,
Shift = 16,
Ctrl = 17,
Alt = 18,
PauseBreak = 19,
CapsLock = 20,
Escape = 27,
Juszczak / get_buffers_number.vim
Created Sep 7, 2017
Returns number of buffers in Vim
View get_buffers_number.vim
function! GetBuffersNumber()
return len(filter(range(1, bufnr('$')), 'buflisted(v:val)'))
Juszczak /
Created Jan 13, 2018
Fix FS Watcher on Ubuntu
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf ; sudo sysctl -p
You can’t perform that action at this time.