Skip to content

Instantly share code, notes, and snippets.

@Radvendii
Radvendii / gist:1970675
Created March 4, 2012 04:33
Error in rakudo/rakudo make
cd src/ops && /usr/local/bin/ops2c C --dynamic perl6.ops
# Parsing perl6.ops...
# Parsed perl6.ops in 4.087 seconds; found 237 ops.
# Ops parsed in 4.090 seconds.
cd src/ops && cc -c -o perl6_ops.o -I/usr/local/include/parrot/4.1.0-devel -I/usr/local/include/parrot/4.1.0-devel/pmc -fno-common -pipe -fstack-protector -I/usr/local/include -pipe -fno-common -I/opt/local/include -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -DDISABLE_GC_DEBUG=1 -DNDEBUG -DHAS_GETTEXT -falign-functions=16 -funit-at-a-time -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wmissing-field-initializers -Wno-miss
@Radvendii
Radvendii / acsl1
Created March 5, 2012 03:31
acsl intermediate contest 1 in one line
# Taeer Bar-Yam
# Commonweath School
# Division Intermediate - 3
# Tested with Rakudo 2011.12
say
(
( #AVERAGE ANNUAL SALARY
([+] #sum
(my @as = #assign @as(Annual Salary) to the Contract value divied by the contract length
(
@Radvendii
Radvendii / acsl2
Created March 5, 2012 03:35
acsl intermediate contest 2 in one line
# Taeer Bar-Yam
# Commonweath School
# Division Intermediate - 3
# Tested with Rakudo 2012.01
say
(
(open('acsl2.txt').lines.map({[.split(' ')]} #Read input and split into lines, and split each line into array by spaces (as specified)
).map( #loop over first level array (each line)
{
[( #array reference (so that the array doesn't flatten)
cpanm (App::cpanminus) 1.6934 on perl 5.014002 built for darwin-2level
Work directory is /Users/taeer/.cpanm/work/1375140179.55793
You have make /usr/bin/make
You have LWP 6.03
You have /usr/bin/tar: bsdtar 2.6.2 - libarchive 2.6.2
You have /usr/bin/unzip
Searching Term::ReadLine::Gnu on cpanmetadb ...
--> Working on Term::ReadLine::Gnu
Fetching http://www.cpan.org/authors/id/H/HA/HAYASHI/Term-ReadLine-Gnu-1.20.tar.gz
-> OK
@Radvendii
Radvendii / tb_multithread.rb
Last active August 29, 2015 14:27
Termbox Multithreading
require 'termbox'
#Small example that shows multithreading breaks ruby termbox
#if the display thread executes AFTER the tb_poll_event thread, the call to tb_poll_event freezes Termbox, not allowing the display to happen
#if, however, we switch the sleep statements and the display thread executes first, there is no problem.
#This shows that the problem is indeed with the interaction between these two functions
#Press any key to exit program
Termbox.initialize_library
bash-3.2$ stack install Agda --verbose
Version 0.1.4.1 (UNKNOWN commits) X86_64
2015-09-30 01:48:41.593563: [debug] Checking for project config at: /Users/dudicusmafudicus/stack.yaml @(stack_AngJd9xqaHO0MmIKblReWF:Stack.Config src/Stack/Config.hs:466:9)
2015-09-30 01:48:41.597278: [debug] Checking for project config at: /Users/stack.yaml @(stack_AngJd9xqaHO0MmIKblReWF:Stack.Config src/Stack/Config.hs:466:9)
2015-09-30 01:48:41.597397: [debug] Checking for project config at: /stack.yaml @(stack_AngJd9xqaHO0MmIKblReWF:Stack.Config src/Stack/Config.hs:466:9)
2015-09-30 01:48:41.677329: [debug] No project config file found, using defaults. @(stack_AngJd9xqaHO0MmIKblReWF:Stack.Config src/Stack/Config.hs:493:13)
2015-09-30 01:48:41.677838: [info] Run from outside a project, using implicit global config @(stack_AngJd9xqaHO0MmIKblReWF:Stack.Config src/Stack/Config.hs:242:13)
2015-09-30 01:48:41.735287: [info] Using resolver: lts-3.7 from global config file: /Users/dudicusmafudicus/.stack/global/stack.yaml @(stack_Ang
environment.systemPackages = with pkgs; [
.
.
.
haskellPackages.Agda
AgdaStdlib
.
.
.
];
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
environment.systemPackages = with pkgs; [
.
.
.
(haskellPackages.ghcWithHoogle (h: with h; [
diagrams
diagrams-gtk
lens
io-memoize
haskeline
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
var html = process.argv[2];
var dom = new JSDOM(html);
var ary = dom.window.document.getElementsByTagName("a");
if(ary.length >= 1)
console.log(ary[0].getAttribute("href"));