This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extremely basic prolog highlighting for kakoune | |
# Updated 2018-05-14 | |
# | |
# It's pretty functional, but it doesn't support all the fanciness it could. | |
# The main bad thing right now is that it doesn't differentiate between calls | |
# to other rules and atoms. | |
hook global BufCreate .*\.(pro|pl)? %{ | |
set-option buffer filetype prolog | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# daboross's kakrc | |
# | |
# ### | |
# | |
# Copyright (c) 2019 David Ross | |
# | |
# This software is provided 'as-is', without any express or implied | |
# warranty. In no event will the authors be held liable for any damages | |
# arising from the use of this software. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
change-directory /home/daboross/Projects/kakoune/save-session.kak | |
edit -debug '*debug*' | |
edit -scratch '*scratch*' | |
edit 'rc/save-session.kak' | |
edit 'src/main.rs' | |
buffer 'src/main.rs' | |
set-register '@' '' | |
set-register '^' '' | |
set-register '"' '' | |
set-register '/' 'restore' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match c.unwrap() { | |
Key::Esc => break, | |
Key::Char(c) => input.push(c), | |
Key::Backspace if !input.is_empty() => { | |
input.remove(input.len()); | |
} | |
_ => {}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
messages_future.map(move |redis_msg| { | |
let lock = refs.lock(); | |
let res: u32 = lock.map(|subscriptions| { | |
subscriptions.get(&channel) | |
.map(|subscription| { | |
subscription.iter() | |
.cloned() | |
.map(|subscription_id| { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate redis; | |
extern crate serde_json; | |
extern crate futures; | |
extern crate futures_cpupool; | |
use redis::Commands; | |
use std::collections::HashMap; | |
use std::thread; | |
use std::cell::Cell; | |
use futures::sync::mpsc::channel; | |
use futures::Sink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(test)] | |
extern crate test; | |
use std::borrow::Cow; | |
use std::collections::HashMap; | |
pub fn test_vec(x: &Vec<(Cow<'static, str>, i32)>, module: &str) -> Option<i32> { | |
x.iter().find(|&&(ref test_module, _)| test_module == module).map(|&(_, level)| level) | |
} | |
pub fn test_map(x: &HashMap<Cow<'static, str>, i32>, module: &str) -> Option<i32> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let x = Struct { | |
a_field: vec![ | |
AnotherStruct { | |
time_period: 8, | |
energy_harvested: stats_max.energyHarvested8, | |
energy_spent_creeps: stats_max.energyCreeps8, | |
energy_spent_control: stats_max.energyControl8, | |
energy_spent_construction: stats_max.energyConstruction8, | |
creep_parts_produced: stats_max.creepsProduced8, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let x = Struct { | |
a_field: vec![ | |
AnotherStruct { | |
time_period: 8, | |
energy_harvested: stats_max.energyHarvested8, | |
energy_spent_creeps: stats_max.energyCreeps8, | |
energy_spent_control: stats_max.energyControl8, | |
energy_spent_construction: stats_max.energyConstruction8, | |
creep_parts_produced: stats_max.creepsProduced8, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
// Transcrypt'ed from Python, 2017-01-31 15:24:02 | |
function main () { | |
var __symbols__ = ['__py3.5__', '__esv6__']; | |
var __all__ = {}; | |
var __world__ = __all__; | |
// Nested object creator, part of the nesting may already exist and have attributes | |
var __nest__ = function (headObject, tailNames, value) { | |
// In some cases this will be a global object, e.g. 'window' |
NewerOlder