Skip to content

Instantly share code, notes, and snippets.

package com.innerverse.completionq;
import com.google.common.util.concurrent.Striped;
import java.util.concurrent.*;
import java.util.function.Supplier;
public class StripedExecutor {
protected final Striped<Semaphore> stripes;
private final ExecutorService executor;
@innerverse
innerverse / xorg.conf
Created November 29, 2016 21:25
Intel Tear Free
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "sna"
Option "TearFree" "true"
Option "DRI" "3"
EndSection
@innerverse
innerverse / startup.js
Created October 15, 2015 21:34
startup for windows - example
var Winreg = require('winreg'),
regKey = new Winreg({ hive: Winreg.HKCU, key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Run' });
regKey.set('sococo',Winreg.REG_SZ,'C:\\Users\\seth\\Documents\\workspace\\sococo-native-shell\\app\\Sococo\\win32\\sococo.exe',function(){});
{
"id":"969eb2a9dd72ce48",
"contents":[
{
"name":"audio",
"channels":[
{
"direction":"recvonly",
"channel-bundle-id":"123456",
"transport":{
@innerverse
innerverse / multipart.sh
Created August 21, 2015 20:54
Multipart curl example
# Auth
curl -i -H "Content-Type: application/json" -X POST -d @/home/seth/cred.json http://localhost:8080/api/v1/user/authenticate
# Pass auth token, json field, and binary file via REST
curl -i -H "Content-Type: multipart/form-data" -H "session-id: e862a33febfc77d0eff87d35d7fb66314580a2d2" -X POST http://localhost:8080/api/v1/send-error-report -F "errorReport=@/home/seth/pr.json;type=application/json" -F "file=@/home/seth/pr.zip;type=application/octet-stream"
@innerverse
innerverse / razer.sh
Created June 6, 2015 22:58
Razer DeathAdder acceleration / Ubuntu 15.04
xinput --set-prop "Razer DeathAdder" "Device Accel Constant Deceleration" 5
@innerverse
innerverse / JsonConfig.java
Created August 5, 2014 15:48
Jackson ObjectMapper in RestEasy
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
@Provider
@Produces({MediaType.APPLICATION_JSON})
@innerverse
innerverse / PaymentBraintreeTask.java
Created September 21, 2011 21:49
Braintree / jBilling plugin
package net.sococo.billingplugins;
import com.braintreegateway.BraintreeGateway;
import com.braintreegateway.Environment;
import com.braintreegateway.Transaction;
import com.braintreegateway.TransactionRequest;
import com.sapienter.jbilling.server.payment.PaymentDTOEx;
import com.sapienter.jbilling.server.payment.db.PaymentAuthorizationDTO;
import com.sapienter.jbilling.server.payment.db.PaymentResultDAS;
import com.sapienter.jbilling.server.pluggableTask.PaymentTask;