Skip to content

Instantly share code, notes, and snippets.

@anka-213
anka-213 / config.nix
Created June 11, 2012 16:36
Opera next override
# ~/.nixpkgs/config.nix
{
packageOverrides = pkgs: let
inherit (builtins) substring stringLength sub;
in {
operaNext = pkgs.lib.overrideDerivation pkgs.opera (oldAttrs:
let s = oldAttrs.preFixup; l=stringLength s; in
rec {
version = "12.00-1450";
@anka-213
anka-213 / find_forum_links.pl
Created May 29, 2013 11:45
Locate the first link in the forum thread to each frame in the xkcd Time comic
aug 29 01:20:40 hjulle-arch systemd-logind[246]: Power key pressed.
aug 29 01:20:41 hjulle-arch systemd[1]: Failed to reset devices.list on /system.slice: Invalid argument
aug 29 01:20:41 hjulle-arch systemd-sleep[21188]: Suspending system...
aug 29 01:20:42 hjulle-arch kernel: PM: Syncing filesystems ... done.
aug 29 01:20:42 hjulle-arch kernel: PM: Preparing system for mem sleep
aug 29 01:20:51 hjulle-arch kernel: Freezing user space processes ... (elapsed 0.077 seconds) done.
aug 29 01:20:51 hjulle-arch kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
aug 29 01:20:51 hjulle-arch kernel: PM: Entering mem sleep
aug 29 01:20:51 hjulle-arch kernel: Suspending console(s) (use no_console_suspend to debug)
aug 29 01:20:57 hjulle-arch kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
aug 22 19:01:07 hjulle-arch systemd-logind[246]: Power key pressed.
aug 22 19:01:07 hjulle-arch systemd-sleep[7053]: Suspending system...
aug 22 19:01:08 hjulle-arch kernel: PM: Syncing filesystems ... done.
aug 22 19:01:08 hjulle-arch kernel: PM: Preparing system for mem sleep
aug 22 19:25:45 hjulle-arch kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
aug 22 19:25:45 hjulle-arch kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
aug 22 19:25:45 hjulle-arch kernel: PM: Entering mem sleep
aug 22 19:25:45 hjulle-arch kernel: Suspending console(s) (use no_console_suspend to debug)
aug 22 19:25:45 hjulle-arch kernel: sd 2:0:0:0: [sda] Synchronizing SCSI cache
aug 22 19:25:45 hjulle-arch kernel: sd 2:0:0:0: [sda] Stopping disk
@anka-213
anka-213 / Xorg.0.log
Created September 15, 2014 12:15
Segfault on dual mouse
[ 9861.810]
X.Org X Server 1.16.0
Release Date: 2014-07-16
[ 9861.810] X Protocol Version 11, Revision 0
[ 9861.810] Build Operating System: Linux 3.15.5-2-ARCH x86_64
[ 9861.810] Current Operating System: Linux hjulle-arch 3.15.8-1-ARCH #1 SMP PREEMPT Fri Aug 1 08:51:42 CEST 2014 x86_64
[ 9861.810] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux_ root=UUID=ff8f26b9-4592-44b5-a10a-c8b4ebd9d446 rw rootflags=subvol=arch quiet nouveaufb fbcon=scrollback:1024k resume=/dev/disk/by-uuid/765e6360-9a02-478c-8582-4e175cff35e9
[ 9861.810] Build Date: 31 July 2014 11:53:19AM
[ 9861.810]
[ 9861.810] Current version of pixman: 0.32.6
// ==UserScript==
// @name Keybr github
// @namespace https://github.com/anka-213
// @version 0.1
// @description Type a github repo using keybr.com
// @author You
// @match http://www.keybr.com/*
// @grant unsafeWindow
// ==/UserScript==
/* jshint -W097, esnext:true */
@anka-213
anka-213 / prime_list.rs
Last active April 19, 2016 21:15 — forked from anonymous/playground.rs
Shared via Rust Playground
#![allow(dead_code, unused_variables)]
struct PrimeList {
primes: Vec<i32>,
}
/// Basically the same as
/// self.primes.iter().cloned().chain(self) on a PrimeList
struct PrimeIter<'a> {
primes: &'a mut PrimeList,
@anka-213
anka-213 / doNotation.rs
Last active April 13, 2016 13:26 — forked from anonymous/playground.rs
Shared via Rust Playground
#![feature(trace_macros)]
#![feature(log_syntax)]
//trace_macros!(true);
macro_rules! id {($e : expr) => ($e)}
macro_rules! vecc {($($t:tt)*) => (Vecc{v:vec!($($t)*)})}
macro_rules! mdo {
@anka-213
anka-213 / LinkedList.rs
Last active April 13, 2016 13:07 — forked from anonymous/playground.rs
Using enum
use std::iter::FromIterator;
enum List { Nil, Cons{value: i32, next: Box<List>}}
fn main() {
let v = vec![1, 5, 3, 8, 12, 56, 1230, 2, 1];
//let root: List = v.iter().cloned().collect();
let root = List::from_iter(v);
@anka-213
anka-213 / playground.rs
Created April 13, 2016 14:48 — forked from anonymous/playground.rs
Shared via Rust Playground
use std::borrow::Cow;
use std::sync::Arc;
fn fizz_buzz(i: i32) -> Cow<'static, str> {
if i % 15 == 0 {
"FizzBuzz".into()
} else if i % 5 == 0 {
"Buzz".into()
} else if i % 3 == 0 {
"Fizz".into()