Skip to content

Instantly share code, notes, and snippets.

View kimmobrunfeldt's full-sized avatar

Kimmo Brunfeldt kimmobrunfeldt

View GitHub Profile
@kimmobrunfeldt
kimmobrunfeldt / render.py
Created February 21, 2020 10:41
Replaces a texture png with given command line input
# Run as: blender -b <filename> -P <this_script> -- <image_path>
# Example: blender -b myfile.blend -P render.py -- new_texture.png
import bpy, sys, os
# Assume the last argument is image path
imagePath = bpy.path.abspath(os.path.join(os.getcwd(), sys.argv[-1]))
if not os.path.exists(imagePath):
print("Image not found:", imagePath)
ssh pi@x.x.x.x
export DISPLAY=:0
chromium-browser --noerrdialogs --kiosk 'https://google.com' --incognito
curl -o test.jpg https://images.unsplash.com/photo-1519606247872-0440aae9b827?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&dl=jude-infantini-574421-unsplash.jpg&s=09862427d88b5ae5cb409700be593adc
convert test.jpg -blur 5 -resize 1000x output.jpg
convert test.jpg -resize 1000x -blur 5 output2.jpg
# open output.jpg && open output2.jpg
const { query } = require('../util/pg')
/*
Usage:
function handler(req) {
const id = req.params.id
const core = new UserCore(req.logger)
return core.getUser(id)
}
#!/usr/bin/env node
const fs = require('fs');
if (!process.argv[2]) {
console.error('Incorrect parameters');
console.error('Usage: ./analytics.js <json-file>');
process.exit(2);
}
#!/usr/bin/env node
const fs = require('fs');
if (!process.argv[2]) {
console.error('Incorrect parameters');
console.error('Usage: ./analytics.js <json-file>');
process.exit(2);
}
@kimmobrunfeldt
kimmobrunfeldt / spectre.c
Created January 4, 2018 14:13 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@kimmobrunfeldt
kimmobrunfeldt / joi-probs.js
Last active December 13, 2017 17:40
joi prob
const Joi = require('joi');
const payload = [{
type: 'book',
author: 'Herman Melville',
},
{
type: 'periodical',
volume: 1,
}, {
{
"name": "Kimmo",
"telegramChannels": [{ "name": "coodiryhmä" }, { "name": "TRESekoilu" }]
}