Skip to content

Instantly share code, notes, and snippets.

View astocko's full-sized avatar
💭
I may be slow to respond.

Alexander Stocko astocko

💭
I may be slow to respond.
View GitHub Profile
@astocko
astocko / c99.l
Created May 6, 2017 20:07 — forked from codebrainz/c99.l
C99 Lex/Flex & YACC/Bison Grammars
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
E ([Ee][+-]?{D}+)
P ([Pp][+-]?{D}+)
FS (f|F|l|L)
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U))
%{
#include <stdio.h>
@astocko
astocko / test_extctxt.rs
Created January 28, 2017 01:48 — forked from kevinmehall/test_extctxt.rs
Rust: Creating a ExtCtxt for quasiquote outside of a syntax extension
#![feature(quote)]
extern crate syntax;
use syntax::print::pprust;
use syntax::codemap::DUMMY_SP;
fn main() {
with_fake_extctxt(|cx| {
let x = quote_expr!(cx, (a+b));
@astocko
astocko / BUILD
Created November 8, 2016 17:48 — forked from bsilver8192/BUILD
Basics of generating a compile_commands.json file with Bazel
py_binary(
name = 'generate_compile_command',
srcs = [
'generate_compile_command.py',
],
deps = [
'//third_party/bazel:extra_actions_proto_py',
],
)
@astocko
astocko / .tmux.conf
Created October 9, 2016 20:03 — forked from jnaulty/.tmux.conf
The best tmux and vim configuration in the universe
# Our .tmux.conf file
# Setting the prefix from C-b to C-s
set -g prefix C-s
# Free the original Ctrl-b prefix keybinding
unbind C-b
#setting the delay between prefix and command
set -sg escape-time 1
# Ensure that we can send Ctrl-S to other apps
bind C-s send-prefix
(defn code-mirror
"Create a code-mirror editor. The parameters:
value-atom (reagent atom)
when this changes, the editor will update to reflect it.
options
:style (reagent style map)
will be applied to the container element
:js-cm-opts
options passed into the CodeMirror constructor
:on-cm-init (fn [cm] -> nil)
(use '[leiningen.exec :only (deps)])
(deps '[[me.raynes/fs "1.4.6"]
[camel-snake-kebab "0.4.0"]
[cheshire "5.6.3"]])
(require '[clojure.java.io :as io])
(require '[camel-snake-kebab.core :as keb])
(require '[cheshire.core :as json])
(require '[me.raynes.fs :as fs])
#![crate_type = "lib"]
pub fn increment(data: &mut u32, next: fn() -> usize) -> usize {
*data += 1;
next()
}
This file has been truncated, but you can view the full file.
/// Generated struct and trait implementations for:
/// ADC
/// Add with Carry
pub struct ADC {}
impl Ins2x<HardCodedOp, Imm8> for ADC {
pub fn ins2x(runtime: &JitRuntime, arg0: HardCodedOp, arg1: Imm8) {
bytes.push(0x14);
}
}
impl Ins2x<GPRegister8, Imm8> for ADC {