This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dbus-send --print-reply --type=method_call --dest=org.mpris.guayadeque /Player org.freedesktop.MediaPlayer.Stop | |
#XF86AudioStop | |
dbus-send --print-reply --type=method_call --dest=org.mpris.guayadeque /Player org.freedesktop.MediaPlayer.Play | |
dbus-send --print-reply --type=method_call --dest=org.mpris.guayadeque /Player org.freedesktop.MediaPlayer.Pause | |
#XF86AudioPlay | |
dbus-send --print-reply --type=method_call --dest=org.mpris.guayadeque /Player org.freedesktop.MediaPlayer.Next | |
#XF86AudioNext |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /etc/apt/sources.list | perl -ne '$H{$_}++ or print' > /tmp/sources.list && sudo mv /tmp/sources.list /etc/apt/sources.list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/2.9/chromedriver_linux64.zip && sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/; | |
#set permissions | |
sudo chmod -R a+rwx /usr/local/bin/chromedriver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.fileUpload = function(req, res) { | |
var form = new formidable.IncomingForm(), | |
files = [], | |
uploadedFilePath, | |
fields = []; | |
form.uploadDir = '/your_path/files'; | |
form.keepExtensions = true; | |
form.on('field', function(field, value) { | |
fields.push([field, value]); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function frisbee () | |
{ | |
//everything in SI units | |
var g = -9.81, //deceleration due to gravity | |
m = 0.175, //mass - change as needed | |
RHO = 1.23, //density of air | |
AREA = 0.0568, //area for the frisbee - change as needed | |
CL0 = 0.1, //lift coefficient parameters | |
CLA = 1.4, | |
CD0 = 0.08, //drag coefficient parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.delete('/messages/:messageIds', function(req, res, next) { | |
var messageIds = req.params.messageIds.split(','); | |
async.forEachLimit(messageIds, 5, function(messageId, callback) { | |
db.delete('messages', messageId, callback); | |
}, function(err) { | |
if (err) return next(err); | |
res.json({ | |
success: true, | |
message: messageIds.length+' message(s) was deleted.' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Prepare S3 access and bucket names | |
var awssum = require('awssum'); | |
var s3 = new awssum.load('amazon/s3').S3({ | |
accessKeyId: '...', | |
secretAccessKey: '..', | |
}); | |
var sourceBucket = 'old-bucket'; | |
var destinationBucket = 'new-bucket'; | |
var listObjectsDone = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pageScroll() | |
{ | |
window.scrollBy(0,100);//based on bandwidth, decrease for slower speeds | |
if(($(window).scrollTop() >= $(document).height() - $(window).height() - 200) ) | |
{ | |
if(($(window).scrollTop() >= $(document).height() - $(window).height())) | |
{ | |
counter++; | |
if(counter >200)//increase if no of answers is huge | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2008-10-17", | |
"Id": "0c762de8-f56b-488d-a4a4-20d1cb31df2f", | |
"Statement": [ | |
{ | |
"Sid": "Allow in my domains", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |