Skip to content

Instantly share code, notes, and snippets.

View Nicd's full-sized avatar

Mikko Ahlroth Nicd

View GitHub Profile
@Nicd
Nicd / gist:6158820
Created August 5, 2013 19:35
Around 800 MB to compile with 'mix compile' in an otherwise empty project, on OS X 10.6.8 with elixir 0.10.1-dev.
defmodule ExCoder do
def encode(str) do
end
def decode("	"), do: " "
def decode("
"), do: """
@Nicd
Nicd / gist:7238099
Last active December 27, 2015 00:29
SailfishOS upgrade error
The upgrade goes fine and "show details" shows the following (I truncated some rows):
Downloading packages...
Downloading archive hash for ...
Downloading archive for component ...
Installing component SailfishOS emulator
/Users/nicd/SailfishOS/emulator/sailfishos.vdi
/Users/nicd/SailfishOS/emulator
@Nicd
Nicd / gist:9503114
Created March 12, 2014 08:42
Elixir looks nice
@doc """
Pop the next mode from the stack and return new Status record with the
mode or nil if there were no modes to pop.
"""
def pop(status) do
[head | tail] = status.mode_stack
status = status.mode_stack tail
case head do
[] -> nil
@Nicd
Nicd / moment.js
Created April 14, 2014 19:18
This is a version of the moment.js datetime library version 2.6.0, modified for importing into a QML project. See https://plus.google.com/+MikkoAhlroth/posts/Gr5PaZxDWLs for the usage instructions.
.pragma library
//! moment.js
//! version : 2.6.0
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
var moment = null;
var initialized = false;
@Nicd
Nicd / .tmux.conf
Last active September 6, 2015 11:49
My .tmux.conf
# UTF-8 on for all windows
set-option -g utf8 on
set-option -g history-limit 10000
set-option -g prefix C-a
# Resize keys
bind u resize-pane -U
bind j resize-pane -D
bind h resize-pane -L
bind k resize-pane -R
@Nicd
Nicd / gist:27c8abd596fec54a4a95
Last active August 29, 2015 14:02
Rebar error when running any make command on an OS X 10.6.8 machine with erlang 17.0 and elixir master (396b1e6)
diesel:elixir nicd$ make clean
cd lib/elixir && ../../rebar clean
Uncaught error in rebar_core: {'EXIT',
{undef,
[{crypto,start,[],[]},
{rebar,run_aux,2,
[{file,"src/rebar.erl"},{line,163}]},
{rebar,main,1,
[{file,"src/rebar.erl"},{line,58}]},
{escript,run,2,
@Nicd
Nicd / nurina.ex
Created August 6, 2014 14:53
A URI parser written in Elixir pattern matching. Written in Elixir 0.10 so won't compile anymore (uses records)
defmodule Nurina do
defrecord Info,
scheme: nil,
hier: nil,
query: nil,
fragment: nil,
valid: true,
authority: nil,
path: nil,
@Nicd
Nicd / moment.js
Created November 24, 2014 11:40
New, smaller patch to use moment.js in Qt 5.2
.pragma library
//! moment.js
//! version : 2.8.4
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
var moment = (function (undefined) {
/************************************
@Nicd
Nicd / gist:96f004461f05f63c9171
Created January 29, 2015 07:45
Jolla msyncd log
tammi 29 09:44:13 Jolla google-contacts-client[19913]: [W] GoogleTwoWayContactSyncAdaptor::contactsFinishedHandler:381 - void GoogleTwoWayContactSyncAdaptor::contactsFinishedHandler() "Google contact sync with account 3 got remote changes: a/m: 352 r: 0."
tammi 29 09:44:14 Jolla google-contacts-client[19913]: [W] {anonymous}::semaphoreError:57 - "Unable to decrement semaphore /tmp/qtcontacts-sqlite-semaphore: Resource temporarily unavailable (11)"
tammi 29 09:44:14 Jolla google-contacts-client[19913]: [W] SharedMemoryManager::table:316 - "Failed to lock key memory region for qtcontacts-sqlite"
tammi 29 09:44:16 Jolla google-contacts-client[19913]: [W] enforceDetailConstraints:2545 - "Invalid detail type: 0"
tammi 29 09:44:16 Jolla google-contacts-client[19913]: [W] ContactWriter::save:2414 - "Error updating contact sql-1353: 3"
tammi 29 09:44:16 Jolla google-contacts-client[19913]: [W] enforceDetailConstraints:2545 - "Invalid detail type: 0"
tammi 29 09:44:16 Jolla google-contacts-client[19913]: [W] C
@Nicd
Nicd / grep.py.diff
Created January 31, 2015 13:59
Fix WeeChat script grep.py to expand home dirs in logfile path
diff --git a/python/grep.py b/python/grep.py
index fd9ca2b..4fd5c64 100644
--- a/python/grep.py
+++ b/python/grep.py
@@ -65,6 +65,12 @@
#
#
# History:
+#
+# 2015-01-31, Nicd-