Skip to content

Instantly share code, notes, and snippets.

@siiky
siiky / NOTES.md
Last active August 17, 2019 09:53
@siiky
siiky / data.scm
Created May 7, 2019 23:12
ちっちゃいなscript to generate random data for a database
(import srfi-1
(chicken format)
(chicken random)
(chicken string))
(define-constant *NAULAS* 150)
(define-constant *NCLIENTES* 100)
(define-constant *NFUNCS* 10)
(define-constant *NINSTRS* 80)
(define-constant *NVENDAS* 40)
@siiky
siiky / espeak-pt.rs
Last active May 22, 2017 18:43
Play the Portuguese phonemes with espeak-ng
#!/usr/bin/env run-cargo-script
use std::process::Command;
use std::thread::sleep;
use std::time::Duration;
fn main() {
let phonemes: Vec<&str> = vec!["[[&]]", "[[&/]]", "[[a]]", "[[&~]]", "[[&U~]]", "[[E]]",
"[[e]]", "[[y]]", "[[i]]", "[[i/]]", "[[O]]", "[[o]]", "[[u]]",
"[[U]]", "[[EU]]", "[[w]]", "[[x]]", "[[R]]", "[[s#]]"];
@siiky
siiky / sizeof.sh
Last active April 8, 2017 21:11
C types size and values
#!/usr/bin/env sh
# How to use:
# 1. `sh sizeof.sh`
# 2. ????
# 3. PROFIT!!!
cat << EOF | cc -Wall -Wextra -pedantic -O3 -static -o sizeof -x c - &&
#include <stdio.h>
#define issigned(type) ((type)(0-1)>0)
#define umaxof(t) (((0x1ULL<<((sizeof(t)*8ULL)-1ULL))-1ULL)|(0xFULL<<((sizeof(t)*8ULL)-4ULL)))
#define smaxof(t) (((0x1ULL<<((sizeof(t)*8ULL)-1ULL))-1ULL)|(0x7ULL<<((sizeof(t)*8ULL)-4ULL)))

Keybase proof

I hereby claim:

  • I am siiky on github.
  • I am siiky (https://keybase.io/siiky) on keybase.
  • I have a public key ASAuLV0mwDoACs_isYrXr2g9_tygNmad1ejatjrQxguUZwo

To claim this, I am signing this object:

@siiky
siiky / rpi3_rust_led.rs
Created January 12, 2017 02:58 — forked from undefinedbehavior/rpi3_rust_led.rs
Rust demo for Pi 3 bare metal
#![feature(asm)]
#![feature(lang_items)]
#![crate_type = "staticlib"]
#![no_std]
const GPIO_BASE: u32 = 0x3F200000; // base address for Pi 2 and Pi 3
fn sleep(value: u32){
for _ in 1..value {
unsafe { asm!("");}
@siiky
siiky / main.rs
Created January 8, 2017 03:09 — forked from anonymous/main.rs
#![feature(non_ascii_idents)]
fn main() {
std::env::args().nth(1)
.ok_or(format!("Usage: {} FILE", std::env::args().next().unwrap())) // File name
.and_then(|filename| {
std::fs::File::open(&filename)
.map_err(|e| (&e as &std::error::Error).description().to_string())
}).map(|f| (f, String::new()))
.map(|(mut f, mut s)| ((&mut f as &mut std::io::Read).read_to_string(&mut s), s))
@siiky
siiky / main.rs
Created January 8, 2017 03:09 — forked from anonymous/main.rs
#![feature(non_ascii_idents)]
use std::io::{Write, BufRead, BufReader};
use std::process::exit;
use std::fs::File;
fn main() {
let args : Vec<_> = std::env::args().collect();
if args.len() != 2 {
#!/usr/bin/env python3
# Display the colors available in a terminal.
for color in range(0, 256):
for i in range(0, 1):
print("\033[38;5;%sm%03s\033[m" % (str(color), str(color)), end=' ')
if color % 10 == 0:
print()
@siiky
siiky / monokai.theme
Created October 16, 2016 01:33
Monokai for Cmus
############################################################
# palette: (almost)
# http://www.colourlovers.com/palette/1718713/Monokai
#
# converted to xterm256 code with:
# https://gist.github.com/MicahElliott/719710
############################################################
# LIGHT_CLAY 233
# CLAY 232
# PINK 197