Skip to content

Instantly share code, notes, and snippets.

View ridhoq's full-sized avatar
🤠

Ridwan Hoq ridhoq

🤠
View GitHub Profile
@NoraCodes
NoraCodes / work_queue.rs
Last active February 21, 2024 15:27
An example of a parallel work scheduling system using only the Rust standard library
// Here is an extremely simple version of work scheduling for multiple
// processors.
//
// The Problem:
// We have a lot of numbers that need to be math'ed. Doing this on one
// CPU core is slow. We have 4 CPU cores. We would thus like to use those
// cores to do math, because it will be a little less slow (ideally
// 4 times faster actually).
//
// The Solution:
#!/usr/bin/env node
function BK() {
var self = this;
this.bkList = [];
this.seenConditionBefore = function(n) {
if (self.bkList[self.calculateConditionIndex(n)])
return true;
else
@austinpray
austinpray / index.js
Last active August 29, 2015 14:06
Kegs and Bottles
var kegsandbottles = (function () {
var temp;
var output = '';
var counter = 0;
var numbers = [5, 7];
var exports = function () {
exports.start();
};
var templates = {
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# look good
# set -g default-terminal "xterm-256color"
set-option -g default-command "reattach-to-user-namespace -l bash"
var ping = require('jjg-ping');
function pingGoogle () {
var connected, disconnected, c, d = 0;
var spikelength, spikedistance = [];
this.run = function() {
ping.system.ping('google.com', function(latency, status) {
if (status) {