Skip to content

Instantly share code, notes, and snippets.

Preparation

First we will create a small program in Rust that will:

  1. print its pid
  2. list all the files and directories in /
use std::{ fs, process };
fn main() {
 println!("{}", process::id());

The .docker folder can contain different things depending on what type of dev environment you want to run

Single-container dev environment

In the case of a single dev environment you can put a config.json file to configure your dev environment. The config json file can contain one of these two properties:

  • image: would be the name of the image to use when creating a dev environment, example repository
  • dockerfile: a path to a dockerfile to use to build the image you want to use for your dev environment, example repository
function toggleZoomMute()
local zoom = hs.appfinder.appFromName("zoom.us")
if (zoom == nil) then
return
end
local unmute = {"Meeting", "Unmute Audio"}
local mute = {"Meeting", "Mute Audio"}
function toggleZoomMute()
local zoom = hs.appfinder.appFromName("zoom.us")
if (zoom == nil) then
return
end
local unmute = {"Meeting", "Unmute Audio"}
local mute = {"Meeting", "Mute Audio"}
@rumpl
rumpl / gist:5247079
Last active December 15, 2015 10:39
Brainfuck interpreter in JavaScript
var fs = require('fs');
var Brainfuck = function () {
};
Brainfuck.prototype.init = function() {
this.data = new Array(30000);
for(var i = 0; i < this.data.length; i++) {
this.data[i] = 0;
@rumpl
rumpl / robot.js
Created December 6, 2012 15:14
test1
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@rumpl
rumpl / gist:964304
Created May 10, 2011 11:34
Play sounds or streams with node
var Naudio = require('./build/default/naudio').Naudio;
var naudio = new Naudio();
// Gimme some country!
naudio.play('http://72.13.81.178:8020', function () {
console.log("It's a stream, this never ends!");
});
@rumpl
rumpl / Twentysix.py
Created December 12, 2010 12:07
Try to find the number 26 with 2,3,4,5 and the four basic operations (+,-,/,*)
import math
# Try to find the number 26 with 2,3,4,5 and the four basic operations (+,-,/,*)
def all_perms(str):
if len(str) <= 1:
yield str
else:
for perm in all_perms(str[1:]):
for i in range(len(perm)+1):