Skip to content

Instantly share code, notes, and snippets.

View gradha's full-sized avatar

Grzegorz Adam Hankiewicz gradha

View GitHub Profile
@gradha
gradha / Vagrantfile
Last active August 29, 2015 14:08
Vagrant ubuntu box to test nimrod, nimble and midnight_dynamite
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
$ youtube-dl -U
youtube-dl is up-to-date (2014.07.10)
$ youtube-dl --verbose zTi9EfujYJM
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'zTi9EfujYJM']
[debug] Encodings: locale UTF-8, fs utf-8, out None, pref UTF-8
[debug] youtube-dl version 2014.07.10
[debug] Python version 2.7.5 - Darwin-13.3.0-x86_64-i386-64bit
[debug] Proxy map: {}
<p>Problematic lines</p>
<table border='1' width='100%'><tr><td>
</td></tr></table>
## ``md_ext_fenced_code``
In markdown whenever you start a span or block with backticks, the text inside
will use `<code>` html blocks. When you enable this extension, code blocks
# 1 "modified_headers/html_extra.h"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 169 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "modified_headers/html_extra.h" 2
#!/bin/sh
# Set errors to bail out.
set -e
# Display commands
#set -v
BASE_DIR=~/shelltest_dropbox_filename_sanitizer
TEST_DIR="${BASE_DIR}/1398956253"
NIM_DIR="${TEST_DIR}/compiler"
NIM_BIN="${NIM_DIR}/bin/nimrod"
@gradha
gradha / nimrod_completion.bash
Created April 26, 2014 17:04
Bash completion for Nimrod compiler http://nimrod-lang.org
#!/bin/bash
# Bash completion for the Nimrod programming language (http://nimrod-lang.org)
# based on the tutorial at
# http://www.debian-administration.org/article/317/An_introduction_to_bash_completion_part_2.
# Pass as first parameter the word to complete and replace nim|tmpl files.
_nimrod_complete_compilable_files()
{
local cur
@gradha
gradha / parent.nim
Created February 14, 2014 16:03
Nimrod test for execShellCMD on macosx. Refers to https://github.com/Araq/Nimrod/pull/811.
import os
proc compile_child() =
let ret = execShellCMD("gcc -o sigsev.exe sigsev.c")
echo "Compilation returned ", ret
proc test() =
assert "sigsev.exe".existsFile, "Maybe compilation failed?"
echo "I'll run the child"
let ret = execShellCMD("./sigsev.exe")
@gradha
gradha / cycle_h.m
Created February 9, 2014 20:58
Generated code for nimrod objc hierarchy test. See https://github.com/Araq/Nimrod/issues/894 for context.
/* Generated by Nimrod Compiler v0.9.3 */
/* (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: MacOSX, amd64, clang */
/* Command for C compiler:
clang -c -w -I/Users/gradha/project/nimrod/root/lib -o /private/tmp/cycle/nimcache/cycle_h.o /private/tmp/cycle/nimcache/cycle_h.m */
#define NIM_INTBITS 64
#include "nimbase.h"
#include <stdio.h>
@gradha
gradha / c.sh
Last active January 4, 2016 03:38
Example of C code calling nimrod, and having troubles with the GC. See http://forum.nimrod-lang.org/t/349 and https://github.com/Araq/Nimrod/issues/856 for more info.
#!/bin/sh
PATH_TO_NIMROD=~/project/nimrod/root/bin/nim
PATH_TO_NIMBASE=~/project/nimrod/root/lib/nimbase.h
DEST_NIMBASE=nimcache/nimbase.h
# Force errors to fail script.
set -e
# Build library for ios.
@gradha
gradha / kill.nim
Last active January 2, 2016 07:08
Because we can
template usethis(v, e: expr): stmt {.immediate.} =
block:
using v
e
when isMainModule:
var a, s = "kill it"
usethis(s):
add(" with fire")
usethis(a):