I hereby claim:
- I am shyiko on github.
- I am shyiko (https://keybase.io/shyiko) on keybase.
- I have a public key whose fingerprint is 0E9D 330A 7704 EFB3 4BB3 6842 E6A6 4EED 7505 2A29
To claim this, I am signing this object:
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.fs.FileSystem; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.SequenceFile; | |
import org.apache.hadoop.io.Writable; | |
import java.io.IOException; | |
import java.lang.reflect.ParameterizedType; | |
import java.lang.reflect.Type; | |
import java.util.List; |
<tableid> = select oid from pg_class where relname = '<tablename>'; | |
<rowid> = select id from ( | |
select rr.id from <tablename> rr left join pg_locks pgl | |
on pgl.classid = <tableid> and pgl.objid = rr.id | |
where pgl.objid is null limit 1 | |
) iq where pg_try_advisory_lock(<tableid>, id); | |
-- select * from pg_locks where locktype = 'advisory'; | |
select pg_advisory_unlock(<tableid>, <rowid>); |
public class Cache<K, V> { | |
private final Map<K, SoftReference<V>> map; | |
public Cache(final int cacheSize) { | |
map = Collections.synchronizedMap(new LinkedHashMap<K, SoftReference<V>>() { | |
@Override | |
protected boolean removeEldestEntry(java.util.Map.Entry<K, SoftReference<V>> eldest) { | |
return size() > cacheSize; |
#!/bin/bash | |
mvn $* | |
if [ $? -gt 0 ] | |
then | |
notify-send -i /usr/share/icons/Humanity/status/64/dialog-warning.svg "Maven" "Build failed." | |
else | |
notify-send -i /usr/share/icons/Humanity/actions/64/gtk-info.svg "Maven" "Build succeeded." | |
fi |
/** | |
* Provides method-invocation-scope variables. | |
* <p/> | |
* Each invocation of {@link #get()} within same method (including nested calls) will yield value previously set by | |
* {@link #set(Object)}. Once {@link #set(Object)} region ends, value is rolled back to the default one (provided | |
* during {@link InvocationLocal} instance construction). | |
* <p/> | |
* Implementation is thread-safe. | |
* | |
* @author <a href="mailto:sshyiko@cogniance.com">sshyiko</a> |
#!/usr/bin/env coffee | |
### | |
prerequisites; | |
$ sudo apt-get install nodejs # whatever | |
$ sudo npm install -g coffee-script | |
### | |
bootstrap = do -> | |
exec = require('child_process').exec |
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>land.of.ooo</groupId> | |
<artifactId>adventure_time</artifactId> | |
<version>0.1.0-SNAPSHOT</version> |
I hereby claim:
To claim this, I am signing this object:
/* | |
Script to download all google fonts and name them with FVD-based filenames | |
- e.g. Rock_Salt.n4.ttf, Open_Sans.i7.ttf | |
*/ | |
var https = require('https'); | |
var http = require('http'); | |
var fs = require('fs'); | |
var async = require('async'); | |
var key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; // google fonts api server-only key |