Skip to content

Instantly share code, notes, and snippets.

🖖
Hi

David Bernard davidB

🖖
Hi
Block or report user

Report or block davidB

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davidB
davidB / AsyncSimpleLinkedList.dart
Last active Dec 14, 2015
SimpleLinkedList for dart, success on single-thread but Failed when used with Future, requestAnimationFrame, httpRequest.onLoadEnd,...
View AsyncSimpleLinkedList.dart
import 'dart:async';
class SimpleLinkedEntry {
SimpleLinkedEntry _next = null;
var _obj;
}
class AsyncSimpleLinkedList<E> {
Future<SimpleLinkedEntry> _head = new Future.immediate(null);
@davidB
davidB / HelloWorld.java
Last active Oct 13, 2015
test uri of gist for run_on_jvm
View HelloWorld.java
public class HelloWorld {
public static void main(String args[]) {
String arg0 = args.length > 0 ? args[0] : "";
System.out.println("Hello World ! " + arg0);
}
}
View backup-github.py
#!/usr/bin/env python
#require PyGithub (pip install PyGithub)
#see https://github.com/jacquev6/PyGithub
import sys
import urllib2
import os
import os.path
from pipes import quote
@davidB
davidB / FakeThreadState.java
Created Jul 21, 2011
I used the following code to check if Thread of java process can have independent state
View FakeThreadState.java
// I used the following code to check if Thread of java process can have independent state with
// ps -Teo state,pcpu,pmem,nlwp,pid,spid,user,args |grep FakeThread
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
// The goal is to create several Thread that should be in different state and check if ps or other catch the correct state of the thread
public class FakeThreadState {
@davidB
davidB / ReCaptcha.scala
Created Oct 8, 2010
code I used to integrate recaptcha with Lift ProtoUser (2.1)
View ReCaptcha.scala
package net_alchim31_vscaladoc2_www.model
/**
* To use ReCaptach (http://www.google.com/recaptcha) :
* * add a project dependency
* <dependency>
* <groupId>net.tanesha.recaptcha4j</groupId>
* <artifactId>recaptcha4j</artifactId>
* <version>0.0.7</version>
You can’t perform that action at this time.