Skip to content

Instantly share code, notes, and snippets.

View clarkio's full-sized avatar
🎷
Cool Jazz

Brian Clark clarkio

🎷
Cool Jazz
View GitHub Profile
@clarkio
clarkio / CSP Harlem Shake Test Instructions.txt
Last active June 5, 2024 21:25
Test script to paste in dev tools console that demonstrates how a CSP can help
// Originally provided here: http://pastebin.com/aJna4paJ
1. Go to Google Chrome
2. Go to any website (works cool on facebook)
3. Right click anywhere -> Inspect Element
4. Click on the rightmost "Console" tab.
5. Copy paste the following * into the console.
6. Make sure the volume isn't too loud!
7. Press Enter.
8. If the audio doesn't play and/or elements on the page don't move then the site has properly implemented a CSP
@clarkio
clarkio / Links for Finding OSS Projects.md
Last active July 18, 2017 23:55
A list of links to help in finding great open source projects to jump in on
@clarkio
clarkio / index-after.js
Created August 11, 2017 19:30
Restify middleware next() blog post code snippets
server.get('/secure/route',
// My short-circuiting middleware "module"
function checkAuthorization (req, res, next) {
res.send(401, 'Unauthorized');
return next(false);
},
// My route implementation
function routeAction (req, res, next) {
res.send(200, { data: 'secure data' });
return next();
@clarkio
clarkio / server.js
Last active August 11, 2017 19:37
Restify middleware next() blog post code snippets - after changes
server.get('/secure/route',
// My short-circuiting middleware "module"
function checkAuthorization (req, res, next) {
res.send(401, 'Unauthorized');
return next(false);
},
// My route implementation
function routeAction (req, res, next) {
res.send(200, { data: 'secure data' });
return next();
@clarkio
clarkio / server.js
Created August 11, 2017 19:39
Restify middleware next() blog post code snippets - before changes
server.get('/secure/route',
// My short-circuiting middleware "module"
function checkAuthorization (req, res, next) {
res.send(401, 'Unauthorized');
return next();
},
// My route implementation
function routeAction (req, res, next) {
res.send(200, { data: 'secure data' });
return next();
// callbacks
foo(params, function (error, fooResult) {
bar(fooResult, function (error, barResult) {
baz(barResult, function (error, bazResult) {
// and on and on... >>>>>>>
});
});
});
@clarkio
clarkio / cloudSettings
Last active October 10, 2019 03:00
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-10-10T03:00:57.381Z","extensionVersion":"v3.4.3"}
@clarkio
clarkio / vs-code-can-do-that-settings.json
Last active May 19, 2018 19:39
VS Code settings to use for recording VS Code Can Do That content
{
"window.zoomLevel": 4,
"editor.formatOnSave": true,
"workbench.iconTheme": "vs-seti",
"workbench.colorTheme": "Monokai Dimmed",
"prettier.singleQuote": true
}
@clarkio
clarkio / settings.json
Created February 9, 2018 00:50
Archive VS Code Settings 08022018
{
"workbench.editor.tabSizing": "shrink",
"explorer.openEditors.visible": 0,
"window.zoomLevel": 1,
"git.confirmSync": false,
"prettier.singleQuote": true,
"prettier.printWidth": 120,
"editor.lineNumbers": "on",
"editor.lineHeight": 0,