Skip to content

Instantly share code, notes, and snippets.

View neurotech's full-sized avatar
🍔
We codin'

Tim Douglas neurotech

🍔
We codin'
View GitHub Profile
@mahiya
mahiya / sqs-sendMessageBatch.js
Last active September 7, 2020 06:23
Sample code of calling AWS.SQS.sendMessageBatch method
var AWS = require('aws-sdk');
var sqs = new AWS.SQS();
const queueUrl = '';
async function sendMessages(messages) {
for (var i = 0; i < messages.length;) {
var params = {
QueueUrl: queueUrl,
Entries: []
};
var resultPromises = Object.keys(queries).map(function(){
var value = queries[key];
return populateTables(value);
});
Promise.all(resultPromises).then(runThisAfterAllFinish);
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active December 1, 2023 08:21
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@JT5D
JT5D / controllable_Webcams.csv
Created January 3, 2014 19:52
controllable Webcams list
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 22 columns, instead of 8. in line 3.
created_utc,score,domain,id,title,author,ups,downs,num_comments,permalink,selftext,link_flair_text,over_18,thumbnail,subreddit_id,edited,link_flair_css_class,author_flair_css_class,is_self,name,url,distinguished
1315403643.0,462,cracked.com,k7kzm,Writer of Cracked.com mentions this subreddit in their article,penguinsmut,493,31,47,http://www.reddit.com/r/controllablewebcams/comments/k7kzm/writer_of_crackedcom_mentions_this_subreddit_in/,,,False,http://thumbs.reddit.com/t3_k7kzm.png,t5_2qt74,False,,,False,t3_k7kzm,http://www.cracked.com/article_19412_8-things-you-wont-believe-can-be-hacked.html,
1339618071.0,159,209.121.28.211,v0dh3,Now we just wait for kinky elevator sex.,Brudus,173,14,97,http://www.reddit.com/r/controllablewebcams/comments/v0dh3/now_we_just_wait_for_kinky_elevator_sex/,,,False,default,t5_2qt74,False,,,False,t3_v0dh3,http://209.121.28.211/anony/mjpg.cgi,
1349006496.0,148,cryptogasm.com,10phl7,"I created a basic web viewer for a load of webcams I discovered (1,392 and counting).",Rsaesha,163,1
@kerimdzhanov
kerimdzhanov / random.js
Last active April 20, 2024 03:21
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
@thcipriani
thcipriani / baller_motd.md
Last active February 12, 2023 12:28
Using img2ponysay to create baller /etc/motd message

Update: I made this a proper blog post

Creating Baller/Useful MOTD Messages

Zangief MOTD

Prerequisites

  • linux box
@jmdobry
jmdobry / Instructions.md
Last active August 31, 2021 18:21
Nginx reverse-proxy for RethinkDB Admin UI

Start your rethinkdb instance with this flag: --bind all (or bind=all in the configuration file for your instance)

Block external access to the web UI with these two commands: sudo iptables -A INPUT -i eth0 -p tcp --dport 8080 -j DROP sudo iptables -I INPUT -i eth0 -s 127.0.0.1 -p tcp --dport 8080 -j ACCEPT

Install nginx: sudo apt-get install nginx

@eviltrout
eviltrout / nntp_connection.rb
Created December 19, 2012 15:35
NNTP Connection Class in Ruby
#
# Example usage:
#
# require 'rubygems'
# require 'date'
# require 'socket'
# require 'celluloid'
# require 'nntp_connection'
#
# nntp = NNTPConnection.new('news.supernews.com', 119, 'username', 'password')
@mxriverlynn
mxriverlynn / findkey.js
Created November 20, 2012 03:48
Find key by value, with underscore.js
function findKey(obj, value){
var key;
_.each(_.keys(obj), function(k){
var v = obj[k];
if (v === value){
key = k;
}
});
@philfreo
philfreo / gist:3208678
Created July 30, 2012 17:52
Gzip files in a directory, upload it to s3 for Cloudfront (far futures)
# imgs don't need to be gzipped
s3cmd put -c config/.s3cfg-prod-static --acl-public --guess-mime-type --add-header "Cache-Control:public, max-age=31536000" -r static/img s3://my-bucket-name/
# js/css does need gzipping
rm -rf static/built-gz;
cp -a static/built/ static/built-gz/;
find static/built-gz -type f | while read -r x; do gzip -9 -c "$x" > "$x.gz"; mv "$x.gz" "$x"; done;
s3cmd put -c config/.s3cfg-prod-static --acl-public --guess-mime-type --add-header "Cache-Control:public, max-age=31536000" --add-header "Content-Encoding: gzip" -r static/built-gz/ s3://my-bucket-name/built/