Skip to content

Instantly share code, notes, and snippets.

@indriApollo
indriApollo / init.lua
Created June 30, 2015 17:11
Adds multiskin support for wardrobe (replace existing init.lua with this code)
local MOD_NAME = minetest.get_current_modname();
local MOD_PATH = minetest.get_modpath(MOD_NAME);
local WORLD_PATH = minetest.get_worldpath();
if MOD_NAME ~= "wardrobe" then
error("mod directory must be named 'wardrobe'");
end
local armor_mod = false;
if minetest.get_modpath("3d_armor") then armor_mod = true; end;
@indriApollo
indriApollo / gitApiV3test.html
Last active February 22, 2016 18:32
Test of the github v3 api using XMLHttpRequest
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Github Api V3 test</title>
<style type="text/css">
textarea{
height: 100%;
}
ul{
from multiprocessing import Process, Value
def f(flag):
i = 0
while flag.value == 1:
i+=1
flag.value = i
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Bresenham demo</title>
<style type="text/css">
.demo {
margin: auto;
width: 466px;
}
@indriApollo
indriApollo / getChanges.js
Created June 11, 2016 14:01
Get a list of changed files since given commit
var githubApi = {};
githubApi.header = {};
githubApi.header.Accept = "application/vnd.github.v3+json"; //make sure we use v3
//githubApi.header.Authorization = "token <token>";
githubApi.baseUrl = "https://api.github.com";
githubApi.username = "indriApollo";
githubApi.nameRepo = "vormleer";
githubApi.list = {};
#!/bin/sh
mkdir ~/scripting
cd ~/scripting
i=1
out=0
while [ $out -eq "0" ]
do
# udev rule : SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0666", SYMLINK+="lsm303agr"
import serial
import re
import time
import signal
import math
# registers
HAL_StatusTypeDef spi3wireRead(uint8_t *pTxData, uint8_t *pRxData, uint16_t TxSize, uint16_t RxSize)
{
if(hspi1.State != HAL_SPI_STATE_READY)
{
return HAL_BUSY;
}
if((pTxData == NULL ) || (TxSize == 0U))
{
@indriApollo
indriApollo / del_all_jpeg.gs
Created April 17, 2017 20:18
Use this to remove all your jpeg's from google drive
// Taken from http://stackoverflow.com/questions/19614583/google-apps-script-to-delete-all-files-from-google-drive
function processAllFiles() {
// We look for the continuation token from the UserProperties
// this is useful as the script may take more that 5 minutes
// (exceed execution time)
var continuationToken = UserProperties.getProperty('DELETE_ALL_FILES_CONTINUATION_TOKEN');
if (continuationToken == null) {
// firt time execution, get all files from drive
var files = DriveApp.getFiles();
sudo apt install cpu-checker
kvm-ok
sudo nano /etc/apt/sources.list
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt update
sudo apt-get install linux-headers-$(uname -r) build-essential virtualbox-5.1 dkms
sudo adduser <user> vboxusers