Skip to content

Instantly share code, notes, and snippets.

View japgolly's full-sized avatar
☠️
Non-existant

David Barri japgolly

☠️
Non-existant
View GitHub Profile
@japgolly
japgolly / gist:1768922
Created February 8, 2012 12:21
java7 in ubuntu
# http://brunoreis.com/tech/intalling-java-ubuntu-natty/
update-alternatives --quiet --install /usr/lib/xulrunner-addons/plugins/libjavaplugin.so xulrunner-1.9-javaplugin.so /usr/lib/jvm/${java_dir}/jre/lib/${arch}/libnpjp2.so 63
update-alternatives --quiet --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib/jvm/${java_dir}/jre/lib/${arch}/libnpjp2.so 63
update-alternatives --quiet --install /usr/bin/appletviewer appletviewer /usr/lib/jvm/${java_dir}/bin/appletviewer 63 --slave /usr/share/man/man1/appletviewer.1 appletviewer.1 /usr/lib/jvm/${java_dir}/man/man1/appletviewer.1
update-alternatives --quiet --install /usr/bin/apt apt /usr/lib/jvm/${java_dir}/bin/apt 63 --slave /usr/share/man/man1/apt.1 apt.1 /usr/lib/jvm/${java_dir}/man/man1/apt.1
update-alternatives --quiet --install /usr/bin/extcheck extcheck /usr/lib/jvm/${java_dir}/bin/extcheck 63 --slave /usr/share/man/man1/extcheck.1 extcheck.1 /usr/lib/jvm/${java_dir}/man/man1/extcheck.1
update-alternatives --quiet --install /
@japgolly
japgolly / .java-7-sun.jinfo
Created February 8, 2012 12:26
java7 in ubuntu #2
name=java-7-sun
alias=java-7-sun
priority=63
section=non-free
jre ControlPanel /usr/lib/jvm/java-7-sun/jre/bin/ControlPanel
jre java /usr/lib/jvm/java-7-sun/jre/bin/java
jre java_vm /usr/lib/jvm/java-7-sun/jre/bin/java_vm
jre javaws /usr/lib/jvm/java-7-sun/jre/bin/javaws
jre jcontrol /usr/lib/jvm/java-7-sun/jre/bin/jcontrol
@japgolly
japgolly / .vimrc
Created February 10, 2012 00:59
.vimrc
call pathogen#infect()
set nobackup
set history=200
syntax on
filetype plugin indent on
set colorcolumn=121 " Margin on the right
set number " Show line numbers on the left
"let g:CSApprox_attr_map = { 'bold' : 'bold', 'italic' : '', 'sp' : '' }
set background=dark
@japgolly
japgolly / gist:1890994
Created February 23, 2012 06:10
ruby-debug19 deps
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1890994)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p125 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
@japgolly
japgolly / error_log.txt
Created March 27, 2012 05:22
RubyProf error log
/home/golly/.rvm/gems/ruby-1.9.3-p125/bundler/gems/ruby-prof-f30efda79fcf/lib/ruby-prof/printers/call_stack_printer.rb:86: [BUG] Segmentation fault
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0091 p:0013 s:0460 b:0459 l:000446 d:000458 BLOCK /home/golly/.rvm/gems/ruby-1.9.3-p125/bundler/gems/ruby-prof-f30efda79fcf/lib/ruby-prof/printers/call_stack_printer.rb:86
c:0090 p:---- s:0456 b:0456 l:000455 d:000455 FINISH
c:0089 p:---- s:0454 b:0454 l:000449 d:000453 IFUNC
c:0088 p:---- s:0452 b:0452 l:000451 d:000451 CFUNC :each
c:0087 p:---- s:0450 b:0450 l:000449 d:000449 CFUNC :any?
c:0086 p:0201 s:0447 b:0447 l:000446 d:000446 METHOD /home/golly/.rvm/gems/ruby-1.9.3-p125/bundler/gems/ruby-prof-f30efda79fcf/lib/ruby-prof/printers/call_stack_printer.rb:86
require 'benchmark'
require 'thread'
require 'monitor'
mutex = Mutex.new
monitor = Monitor.new
nop = proc{}
range = 1..1_000_000
for j in 1..20
@japgolly
japgolly / gist:2485642
Created April 25, 2012 02:29
JRuby JSON lib benchmarks
=================================================================================================================
jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (OpenJDK 64-Bit Server VM 1.7.0_03-icedtea) [linux-amd64-java]
ENGINES: [:jr_jackson]
REPS: 100000
WARMUPS: 5
------------------------------------------------------------------
Writing (warmup)
user system total real
@japgolly
japgolly / prob.rb
Created September 12, 2012 04:06
Issue with RSpec and at_exit
def dynamic_fixture_root
$gu_dynamic_fixture_root || DYNAMIC_FIXTURE_ROOT_LOCK.synchronize {
$gu_dynamic_fixture_root ||= (
at_exit {
FileUtils.remove_entry_secure $gu_dynamic_fixture_root if $gu_dynamic_fixture_root
$gu_dynamic_fixtures= $gu_dynamic_fixture_root= nil
}
Dir.mktmpdir
)
}
@japgolly
japgolly / mvnc.sh
Last active October 12, 2015 23:28
Mvn colour script
#!/bin/bash
RESET="\e[0m"
BLACK="\e[0;30m"
RED="\e[0;31m"
GREEN="\e[0;32m"
YELLOW="\e[0;33m"
BLUE="\e[0;34m"
MAGENTA="\e[0;35m"
CYAN="\e[0;36m"
package japgolly.scalajs.react
import scala.concurrent.duration.Duration
import scala.concurrent.{ExecutionContext, Await, Future}
object Blah {
private val DefaultMaxWait = Duration.Inf
implicit class FutureExt[A](val f: Future[A]) {