I hereby claim:
- I am nrk on github.
- I am nrk (https://keybase.io/nrk) on keybase.
- I have a public key whose fingerprint is 10FD 7831 4575 D9BE A1AD DE06 6F02 4C0D CE75 5CFF
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// runtest.io | |
TestSuite clone setPath(System launchPath) run |
foo := block(str, | |
str asMutable asCapitalized println | |
) | |
foo call("my awesome string") // ==> My awesome string | |
foo message // ==> str asMutable asCapitalized println | |
foo message next // ==> asMutable asCapitalized println | |
foo message next next // ==> asCapitalized println | |
adaniele@nutcracker:~/ironruby$ mono bin/ir.exe | |
IronRuby 1.0.0.1 on .NET 2.0.50727.42 | |
Copyright (c) Microsoft Corporation. All rights reserved. | |
Note that local variables do not work today in the console. | |
As a workaround, use globals instead (eg $x = 42 instead of x = 42). | |
>>> puts 'hello' | |
hello | |
=> nil |
// | |
// File: fsevents_windows.go | |
// Date: October 29, 2013 | |
// Author: Peter Krnjevic <pkrnjevic@gmail.com>, on the shoulders of many others | |
// | |
// This code sample is released into the Public Domain. | |
// | |
package fsevents | |
import ( |
# | |
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/) | |
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/ | |
# | |
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything | |
# | |
# Alternative to http://www.groths.org/trim-enabler-3-0-released/ | |
# Method behind this madness described: http://forums.macrumors.com/showthread.php?t=1409151&page=4 | |
# See discussion in comments here: https://www.macupdate.com/app/mac/39654/lion-tweaks | |
# And here: http://forums.macrumors.com/showthread.php?t=1410459 |
// Parsing posts from tumblr using JSON | |
JSON | |
Regex | |
Map squareBrackets := method( | |
return self at(call evalArgs at(0)) | |
) | |
URL with("http://staff.tumblr.com/api/read/json") fetch findRegex("^var tumblr_api_read = (.*);\s*$") ?at(1) fromJSON ["posts"] foreach(post, post ["type"] println) |
http = require "socket.http" | |
require "json" | |
local json_res = http.request("http://staff.tumblr.com/api/read/json") | |
local tumblr = json.decode(string.match(json_res, "^var tumblr_api_read = (.*);%s*$")) | |
for _, post in ipairs(tumblr.posts) do print(post.type) end | |
--[[ **** OUTPUT **** |
IronRuby 1.0.0.0 on .NET 2.0.50727.1433 | |
Copyright (c) Microsoft Corporation. All rights reserved. | |
Note that local variables do not work today in the console. | |
As a workaround, use globals instead (eg $x = 42 instead of x = 42). | |
>>> require 'mscorlib' | |
=> true | |
>>> require 'Win32API' | |
=> true |
irb(main):001:0> require 'Win32API' | |
=> true | |
irb(main):002:0> $get_logical_drives = Win32API.new('kernel32', 'GetLogicalDriveStrings', ['P', 'P'], 'I') | |
=> #<Win32API:0x2e2a200> | |
irb(main):003:0> $buffer = ' ' * 32 | |
=> " " | |
irb(main):004:0> $length = $get_logical_drives.call($buffer.length, $buffer) | |
=> 16 | |
irb(main):005:0> $buffer | |
=> "A:\\\000C:\\\000D:\\\000S:\\\000\000 " |