Skip to content

Instantly share code, notes, and snippets.

View rexim's full-sized avatar
📺
https://twitch.tv/tsoding

Alexey Kutepov rexim

📺
https://twitch.tv/tsoding
View GitHub Profile
#include <iostream>
#include <string>
using namespace std;
template <typename T>
struct Node
{
T data;
Node* next;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Alexey Kutepov a.k.a. rexim
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
@rexim
rexim / tortoise_and_hare.hs
Created August 7, 2014 18:24
Tortoise-and-hare algorithm
import Data.Array
type LinkedList = Array Int Int
-- Tests ------------------------------
makeTest :: [Int] -> LinkedList
makeTest xs = array (1, n) $ zip [1 .. n] xs
where n = length xs
--- mytits.json 2015-06-22 21:04:35.765208405 +0600
+++ package.json 2015-06-22 20:50:51.645234253 +0600
@@ -16,7 +16,7 @@
},
"repository": {
"type": "git",
- "url": "https://github.com/pspeter3/typescript-register.git"
+ "url": "git+https://github.com/pspeter3/typescript-register.git"
},
"keywords": [
@rexim
rexim / emacs-windows-xbm-bug.el
Created October 25, 2015 09:02
Emacs Windows XBM bug
;;; -*- lexical-binding: t -*-
;; 1. Copy this code to an Emacs buffer
;; 2. M-x eval-buffer
(let ((width 90)
(height 90)
(tiles-column-count 3)
(tiles-row-count 3)
(foreground-color "red")
(background-color "blue"))
@rexim
rexim / io-probe.el
Created March 25, 2016 10:34
IO probe for GCJ
(require 'cl-lib)
(defun read-next-word ()
(let ((end (progn (forward-word)
(point)))
(start (progn (backward-word)
(point))))
(forward-word)
(buffer-substring start end)))
@rexim
rexim / example.ml
Created April 14, 2016 17:02 — forked from Minoru/example.ml
OCamlin' along with @rexim
let on f g = fun x y -> f (g x) (g y)
# uncurry from https://thelema.github.io/batteries-included/hdoc/BatPervasives.html
# dunno if you can use that
# line 15 can't be rewritten like that.
# I'm still trying to come up with another solution, but it's really different from the other two
# line 16
List.map (fun (vx, vy) -> atan2 (float_of_int vy) (float_of_int vx))
Updating registry `https://github.com/rust-lang/crates.io-index`
Downloading conrod v0.35.0
Compiling winapi-build v0.1.1
Compiling bitflags v0.6.0
Compiling read_color v0.1.0
Compiling num-traits v0.1.32
Compiling winapi v0.2.7
Compiling rustc-serialize v0.3.19
Compiling kernel32-sys v0.2.2
Compiling fixedbitset v0.1.1

Usage

$ git clone [email protected]:musitdev/portmidi-rs.git
$ nix-shell midi-looper.nix -A midiLooperEnv
$ cd portmidi-rs

$ cargo run --example play