Skip to content

Instantly share code, notes, and snippets.

root@player:~# cd /usr/src
root@player:/usr/src# apt-get install -y golang
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
golang-doc golang-go golang-go-linux-amd64 golang-src
Suggested packages:
golang-go.tools
The following NEW packages will be installed:
luck@hhvm-dev:~/dev/facebook/hhvm$ hphp/hhvm/hhvm --version
HipHop VM 3.1.0-dev (dbg)
Compiler: heads/master-0-gd8a76b38834df17dea1faf1901b13d8e68ba04a3
Repo schema: b95de36ef533ec293e848834591b8ca6834c99ba
luck@hhvm-dev:~/dev/facebook/hhvm$ cat test1.php
<?php
namespace Test;
@lbogdan
lbogdan / log.js
Created May 31, 2017 19:44
Generic log level
var logLevels = {
error: {
prio: 0, // lower has priority
method: "error"
},
warning: {
prio: 1,
method: "warn"
},
info: {
@lbogdan
lbogdan / theme.js
Last active December 10, 2017 00:38
TinyMCE theme
(function () {
var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
// Used when there is no 'main' module.
// The name is probably (hopefully) unique so minification removes for releases.
var register_3795 = function (id) {
var module = dem(id);
var fragments = id.split('.');
var target = Function('return this;')();
const path = require('path');
const puppeteer = require('puppeteer');
const AWS = require('aws-sdk');
const s3Config = {
apiVersion: '2006-03-01',
region: 'eu-central-1',
bucket: 'codesandbox-thumbnails',
};
const puppeteerConfig = {
const Koa = require('koa');
const Router = require('koa-router');
const AWS = require('aws-sdk');
const app = new Koa();
const router = new Router();
const thumbnails = {};
AWS.config.loadFromPath('./aws_lambda.json');
@lbogdan
lbogdan / sol.sh
Last active September 1, 2018 11:15
shutdown on lan
#!/bin/bash
INTERFACE=ens33 # interface we're listening on
NUM_PACKETS=3 # number of packets sent at once
TIME_THRESHOLD=3 # max seconds between packets
PACKET_THRESHOLD=3 # packets needed to run command
COMMAND="echo DONE!" # command to run
packet_count=0
last_timestamp=0
@lbogdan
lbogdan / sync.md
Created October 24, 2018 09:15
Feature: synchronize externally modified sandbox files with the API

Feature: synchronize externally modified sandbox files with the API

Steps:

  1. the agent detects the change, sends it to the manager
  2. the manager sends the change to an authenticated API endpoint
  3. the API process the change (uploads the file if binary, updates the DB)
  4. the manager sends an external change notification to all connected clients
  5. the client refetches the sandbox contents (lazy fetching?)

Detecting the change - agent

@lbogdan
lbogdan / prerequisites.md
Last active January 22, 2019 20:25
[WIP] Intro to Vue.js Workshop

At the beginning of the workshop you should have all of the following installed:

@lbogdan
lbogdan / build.sh
Created May 25, 2020 20:41
cri-o 1.18.1 .deb build script for ubuntu 18.04
#!/bin/sh
# run this inside an Ubuntu 18.04 container
set -e
set -u
set -x
DH_GOLANG_DEB=dh-golang_1.48_all.deb
BUILD_DIR=cri-o