Skip to content

Instantly share code, notes, and snippets.

Avatar
🦋
Chasing butterflies

Jérôme Prudent jprudent

🦋
Chasing butterflies
View GitHub Profile
View loop3.rb
bass = (ring :d, :r, :r, :a, :f5, :r, :a, :r)
bass2 = (ring :d, :r, :r, :Bb, :g5, :r, :Bb, :r)
live_loop :hanabera do
sync :metronom
use_synth :fm
if (one_in(12))
melody = bass2
else
melody = bass
end
View loop2.rb
use_bpm 102
delta = (line 0, 0.1, steps: 5).mirror
chords = knit(:minor, 5, :m7, 5)
tonics = knit(60, 10, 65, 10)
live_loop :foo do
use_synth :dsaw
sync :kick
play chord(tonics.tick, chords.tick(:chord)), sustain: 1.9, amp: 0.1
sleep 1
@jprudent
jprudent / aoc2019.clj
Last active Dec 8, 2019
Advent of code 2019
View aoc2019.clj
;; _ _ _ __ ____ _
;; / \ __| |_ _____ _ __ | |_ ___ / _| / ___|___ __| | ___
;; / _ \ / _` \ \ / / _ \ '_ \| __| / _ \| |_ | | / _ \ / _` |/ _ \
;; / ___ \ (_| |\ V / __/ | | | |_ | (_) | _| | |__| (_) | (_| | __/
;;/_/ \_ \__, _| \_/ \___|_| |_| \__| \___/|_| \____ \___/ \__, _| \___|
;; ____ ___ _ ___
;; |___ \ / _ \/ |/ _ \
;; __) | | | | | (_) |
View ptrace_ext3.c
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <sys/user.h>
#include <sys/reg.h>
void fizzbuzz() {
@jprudent
jprudent / build.boot
Created May 23, 2017
Boot SOAP binary client generator from WSDL in 2017
View build.boot
(set-env! :dependencies '[[me.raynes/conch "0.8.0"]
[onetom/boot-lein-generate "0.1.3" :scope "test"]]
:source-paths #{"src"})
(require 'boot.lein)
(boot.lein/generate)
(task-options!
@jprudent
jprudent / playground.rs
Created Jan 18, 2017 — forked from anonymous/playground.rs
Shared via Rust Playground
View playground.rs
struct Hook;
struct Timer;
struct ComputerUnit<'a> {
hooks: Vec<&'a mut Hook>,
memory: Mmu<'a>
}
impl<'a> ComputerUnit<'a> {
fn new(hooks: Vec<&'a mut Hook>, timer: &'a Timer) -> ComputerUnit<'a> {
@jprudent
jprudent / channels.rs
Created Jan 16, 2017
Playing with Rust channels
View channels.rs
#[cfg(test)]
mod tests {
use std::sync::mpsc::{sync_channel, SyncSender, Receiver};
use std::thread;
enum TimerCommand {
Read,
Write(u8),
Update(u8)
}
@jprudent
jprudent / playground.rs
Created Jan 14, 2017 — forked from anonymous/playground.rs
Shared via Rust Playground
View playground.rs
struct CpuHook {
counter: u64
}
impl CpuHook {
pub fn inspect(&mut self, cpu: &Cpu) {
// here I don't use the cpu but I could log the cpu register in a mutable file for instance
self.counter = self.counter.wrapping_add(1);
}
}
@jprudent
jprudent / playground.rs
Created Jan 12, 2017 — forked from anonymous/playground.rs
Shared via Rust Playground
View playground.rs
struct Element {
x: u8
}
impl Element {
pub fn inc(&mut self, container: &Container) {
self.x = self.x + 1;
}
}
View ptrace_ex_6.c
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <sys/user.h>
#include <sys/reg.h>