Skip to content

Instantly share code, notes, and snippets.

View scarvell's full-sized avatar

Brendan Scarvell scarvell

View GitHub Profile
@scarvell
scarvell / yubikey
Last active October 24, 2016 11:07
/etc/udev/rules.d/70-u2f.rules
# this udev file should be used with udev 188 and newer
ACTION!="add|change", GOTO="u2f_end"
# Yubico YubiKey
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0113|0114|0115|0116|0120|0402|0403|0406|0407|0410", TAG+="uaccess"
# Happlink (formerly Plug-Up) Security KEY
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="f1d0", TAG+="uaccess"
# Neowave Keydo and Keydo AES
@scarvell
scarvell / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// Copyright John Leitch 2010 [email protected]
var destination = null;
var useClone = false;
var cloneSource = null;
var cloneDelay = 1000;
function hookInputs() {
var frame = document.getElementById('overlayFrame');
var keyPressScript =
https://www.thebuddyforum.com/demonbuddy-forum/demonbuddy-support/173968-using-buddywizard-error-msvcr100-dll-missing.html
function User (userData) {
this.id = userData.id;
this.firstName = userData.firstName;
this.lastName = userData.lastName;
this.displayName = this.firstName + " " + this.lastName;
this.email = userData.email;
this.admin = userData.admin || 0;
this.checkRights = function (code) {
var kkeys = [], keys = "38,38,40,40,37,39,37,39,66,65";
$(document).keydown(function(e) {
kkeys.push(e.keyCode);
if (kkeys.toString().indexOf( keys ) >= 0) {
$('*').each(function(index, element) {
var r = Math.round(Math.random()*255),
g = Math.round(Math.random()*255),
b = Math.round(Math.random()*255);
$(element).css('color', 'rgb('+r+','+g+','+b+')');
/**
* Guitar Tab template generator
*/
(function(strings){
Array.prototype.forEach.call(strings, function (s) {
var i = 0, str='';
while (i < 63) {
str += '-';
var mysql = require('mysql');
var dbConfig = {
host: '',
user: '',
pwd: '',
db: ''
};
pool = mysql.createPool({
client.connect(function(){
module.exports = client;
});
---------------------------------
pg.connect(conString, function(err, client, done) {
module.exports = {client: client, done:done};
});
app.get('/', function(req, res){
var ua = req.header('user-agent');
if(/mobile/i.test(ua)) {
res.render('mobile.html');
} else {
res.render('desktop.html');
}
});