Skip to content

Instantly share code, notes, and snippets.

@pingw33n
pingw33n / linux_cargo_test.sh
Last active May 13, 2020 13:26
Running `cargo test` in Linux Docker container
mkdir -p target/docker_cargo; docker run --rm -it --user "$(id -u)":"$(id -g)" -v "$PWD":/usr/src/app -v "$PWD/target/docker_cargo":/usr/local/cargo/registry -w /usr/src/app rust:$(rustc -V | awk '{print $2}') cargo test
@pingw33n
pingw33n / pom.xml
Last active February 7, 2016 20:05
Maven Qooxdoo SDK Installer
<!--
This POM downloads and installs Qooxdoo SDK into local Maven repository.
Note that the installed ZIP won't include the top level qooxdoo-x.x.x-sdk directory.
Usage:
mvn [-Dqx.version=5.0.1]
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>net.emphased.qooxdoo</groupId>
+
>
,
[
--------------------------------
is space?
[ no
- is exclamation mark?
[ no
@pingw33n
pingw33n / Brainfucking
Created July 9, 2014 18:48
Give it some "Hello World!" input
+>,[--------------------------------[-[+++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.-------.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..<.>--.+++++++++++++.[-]<[-]<[->+>+<<]>>[-<<+>>]<>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]>[-]>[-]+<<<[-<->>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]+<[>-<[-]]>[>[-]<<<[-]>>[-]]<<]>>>[<<<<<-------------------------------->>>>>[-]]<<<<<.[>]>>]<[>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++.---------------------.+++++++++.-----------.++++++++++++.------------.+++++++++++++++++++.-----------.++++++.-.+++++++++++++++++.------------------.------------.+++++++++++++++++.-------.[>]>>]]<[>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.---.---------------.++.++.[>]>>]>,[<++++++++++++++++++++++++++++++++.+++++++++++.-----------.>>]<]
@pingw33n
pingw33n / gist:eca2cf009cdad4c5dbc4
Created July 2, 2014 12:15
VolatileVsSynchronized Caliper benchmark
package benchmark;
import com.google.caliper.runner.CaliperMain;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
public class VolatileVsSynchronized {
public interface Common {
@pingw33n
pingw33n / ibackup-sms-xml-converter.py
Created February 12, 2014 17:54
iBackup SMS to XML converter
#!/usr/bin/env python
#######################################################################
# This is a script that converts iTunes SMS backup database (that is stored
# inf 3d0d7e5fb2ce288813306e4d4636395e047a3d28 file) into
# an XML file that can be restored on Android with SMS Backup & Restore
# app (https://play.google.com/store/apps/details?id=com.riteshsahu.SMSBackupRestore)
#
# Usage:
# python ibackup-sms-xml-converter.py /path/to/3d0d7e5fb2ce288813306e4d4636395e047a3d28 /path/to/smses.xml
@pingw33n
pingw33n / install_jogl_maven.sh
Created November 23, 2012 16:11 — forked from tysonmalchow/install_jogl_maven.sh
install jogamp's JOGL and GLUEGEN jars to a local maven repository
#!/bin/bash
set -e
if [ $# == 0 -o $# -gt 3 ]; then
echo "usage: $0 version [base_url] [maven_repo]"
echo "defaults:"
echo " base_url=http://jogamp.org/deployment/v<version>"
echo " maven_repo=`echo ~/.m2/repository`"
echo "example:"
@pingw33n
pingw33n / CyclicByteBuffer.java
Created July 12, 2012 15:32
CyclicByteBuffer
import java.io.IOException;
import java.io.InputStream;
import java.nio.BufferOverflowException;
/**
* Cyclic byte array backed buffer that allows independent reads and writes.
*/
public class CyclicByteBuffer
{
public CyclicByteBuffer(int capacity)
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/local/bin/geany...done.
JavaScript Value JavaScript Type Java Type Is Scriptable Is Function
{a:1, b:['x','y']} object org.mozilla.javascript.NativeObject + -
[1,2,3] object org.mozilla.javascript.NativeArray + -
1 number java.lang.Double - -
1.2345 number java.lang.Double - -
NaN number java.lang.Double - -
Infinity number java.lang.Double - -
-Infinity number java.lang.Double - -
true boolean java.lang.Boolean -
-