I hereby claim:
- I am timyates on github.
- I am tim_yates (https://keybase.io/tim_yates) on keybase.
- I have a public key whose fingerprint is AADD 8CA6 0A80 20EE 11D1 96AF 5FA1 D919 F8A8 5C13
To claim this, I am signing this object:
// And similar in Panama (Azul java 16.0.2 with --add-modules jdk.incubator.foreign) | |
package com.bloidonia; | |
import jdk.incubator.foreign.GroupLayout; | |
import jdk.incubator.foreign.MemoryLayout; | |
import jdk.incubator.foreign.MemoryLayouts; | |
import jdk.incubator.foreign.MemorySegment; | |
import jdk.incubator.foreign.SequenceLayout; | |
import java.lang.invoke.VarHandle; |
// Version using experimental co-routines in 1.1 thanks to @voddan on Slack | |
import kotlin.coroutines.experimental.buildSequence | |
fun <T> Sequence<T>.repeat() : Sequence<T> = buildSequence { | |
while(true) yieldAll(this@repeat) | |
} | |
fun main(args: Array<String>) { | |
sequenceOf(1, 2, 3).repeat().take(6).forEach { i -> println(i) } | |
} |
I hereby claim:
To claim this, I am signing this object:
@Grab('net.sourceforge.nekohtml:nekohtml:1.9.16') | |
def outFolder = new File("/folder/to/download/to") | |
outFolder.mkdirs() | |
def url = 'http://www.pbase.com/USERNAME/GALLERYNAME&page=all' | |
def parser = new org.cyberneko.html.parsers.SAXParser() | |
new XmlSlurper(parser).parse(url) | |
.'**' |
// Change a method reference into a closure that takes the delegate as the first parameter | |
import org.codehaus.groovy.runtime.MethodClosure | |
def uncurry(MethodClosure c) { | |
{a, ...b -> a."$c.method"(*b) } | |
} | |
// So uncurrying Number.plus gives us a closure that will take {x, y -> x.plus(y)} | |
def plus = uncurry(Number.&plus) | |
assert plus(1, 2) == 3 |
package fizzbuzz; | |
import javaslang.collection.Stream; | |
import javaslang.control.Option; | |
import static javaslang.control.Option.none; | |
import static javaslang.control.Option.some; | |
public class SlangFizzBuzz { | |
public static void main(String[] args) { |
def a = [foo: [foo: true, bar: true]] | |
def b = [foo: [bar: false, baz: true]] | |
Map.metaClass.deepMerge = { Map other -> | |
(delegate.keySet() + other.keySet()).collectEntries { key -> | |
def (d, o) = [delegate, other]*.get(key) | |
if(d instanceof Map && o instanceof Map) { | |
[key, d.deepMerge(o)] | |
} | |
else { |
import java.util.List; | |
import java.util.Spliterator; | |
import java.util.Spliterators; | |
import java.util.function.IntConsumer; | |
import java.util.function.Supplier; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
import java.util.stream.StreamSupport; | |
public class ParallelStreamTest { |
package com.bloidonia.meddling; | |
@FunctionalInterface | |
public interface Source<T> { | |
default void yield(T value) { | |
System.out.println(value); | |
} | |
default void run() { | |
apply(this); |
Didn't work any of this out, I just stuck things together that I found on the web
First, install the things:
brew install imagemagick
brew install ffmpeg
Then, I have a small (600px wide) iTerm window with a big font. Load Quicktime, and record screen (just the area of the terminal)
Trim and save the mov
somewhere (lets say ~/Documents/term.mov
)