Skip to content

Instantly share code, notes, and snippets.

const sqlite = require('better-sqlite3');
const path = require('path');
const fs = require('fs');
const debug = require('debug')('db');
debug('Running file');
let isInitialized;
function exportDb() {
const DBFILE = path.join(__dirname, 'database.sqlite3');
const db = sqlite(DBFILE);
@j000
j000 / build.log
Last active October 6, 2020 21:06
 * Package: sci-libs/libmed-3.1.0
 * Repository: science
 * Maintainer: sci@gentoo.org
 * USE: abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
 * FEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking med-3.1.0.tar.gz to /var/tmp/portage/sci-libs/libmed-3.1.0/work
>>> Source unpacked in /var/tmp/portage/sci-libs/libmed-3.1.0/work
>>> Preparing source in /var/tmp/portage/sci-libs/libmed-3.1.0/work/med-3.1.0_SRC ...
* Applying libmed-3.1.0-cmake-fortran.patch ...
#define spacje " "
void prawa(int linia,char *tekst)
{
pthread_mutex_lock(&print);
/* wyczyść linijkę */
printf("\033[%u;0H" spacje spacje, linia);
/* przenieś kursor na prawą stronę */
printf("\033[%u;0H" spacje, linia);
/* wypisz nasz tekst */
void wypisz_lewo(const unsigned linia, const char *tekst) {
pthread_mutex_lock(&print);
/* usuń "linię" i ustaw kursor po lewej i wypisz tekst */
printf("\033[%u;0H" spacje spacje "\033[%u;0H%s", linia, linia, tekst);
fflush(stdout);
pthread_mutex_unlock(&print);
}
@j000
j000 / Makefile
Last active June 12, 2018 18:28
Czytelnicy i pisarze
# Jarosław Rymut
### 'private' wymaga przynajmniej GNU make 3.82 z 2010 roku ###
# numer zestawu
zestaw := $(notdir $(lastword $(CURDIR)))
# nazwa spakowanego pliku
tar := Rymut_$(zestaw).tar.gz
# flagi
CFLAGS := -std=c99 -O2 -Wall -Wextra
@j000
j000 / Makefile
Created May 27, 2018 21:16
PGO Test
SRC := rays.cpp
SRC += $(filter-out $(SRC),$(wildcard *.cpp))
########################################
EXE := $(basename $(firstword $(SRC)))
SRCDIR ?= .
TMPDIR ?= .tmp
PGODIR ?= .pgo
########################################
SHELL := /bin/sh
MKDIR ?= mkdir
@j000
j000 / gentoo-on-pogoplug.md
Last active November 9, 2022 18:15
Gentoo on Pogoplug v4

Gentoo on Pogoplug v4

Little how-to, written to remember later

Cheating: For now first step is to get Arch Linux ARM running on Cubieboard. SSH into Arch install, update u-boot.

Download stage 3 ARMv5tel https://www.gentoo.org/downloads/#arm

sudo fdisk /dev/sdX

  • +-150M, boot partition, needed for kernels etc.; type: b W95 FAT32
@j000
j000 / gentoo-on-cubieboard.md
Created June 15, 2017 01:02
Gentoo on Cubieboard
@j000
j000 / freebsd-to-gentoo.sh
Last active June 9, 2017 23:47
DigitalOcean experiments
#!/bin/sh
##########
# usage:
# curl -O -L 'https://gist.github.com/j000/42a75d1402f723038a559047930773bc/raw/freebsd-to-gentoo.sh' && sudo sh freebsd-to-gentoo.sh
##########
if [ $(id -u) -ne 0 ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@j000
j000 / factorio-recipe-parser.lua
Last active November 12, 2017 16:41 — forked from pfmoore/factorio-recipe-parser.lua
Parse the Factorio recipe files to create a CSV of recipes
local write = io.write
function print_me(write,...)
local n = select("#",...)
for i = 1,n do
local v = tostring(select(i,...))
write(v)
if i~=n then write'\t' end
end
write'\n'
end