Skip to content

Instantly share code, notes, and snippets.

View Jegp's full-sized avatar

Jens Egholm Pedersen Jegp

View GitHub Profile
@Jegp
Jegp / Main.cpp
Last active August 29, 2015 13:56
Simple emscripten test
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <emscripten.h>
int x = 0;
int y = 0;
SDL_Surface *screen;
@Jegp
Jegp / dmesg
Last active August 29, 2015 13:57
[ 0.000000] Linux version 3.3.8 (blogic@Debian-60-squeeze-64-minimal) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Sat Mar 23 16:49:30 UTC 2013
[ 0.000000] MyLoader: sysp=444ba8b5, boardp=5fbcaeef, parts=ebc66edc
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[ 0.000000] SoC: Atheros AR9330 rev 1
[ 0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone PFN ranges:
@Jegp
Jegp / BambooTest.java
Created August 21, 2014 08:48
IMBA CERN test
public class BambooTest {
private boolean bambooNeedsSomeTestsResultsToMarkThisProjectGREEN = true;
@Test
public void test1() {
Assert.assertTrue(bambooNeedsSomeTestsResultsToMarkThisProjectGREEN);
}
}
@Jegp
Jegp / keybase.md
Created October 3, 2014 12:26
keybase.md

Keybase proof

I hereby claim:

  • I am jegp on github.
  • I am jegp (https://keybase.io/jegp) on keybase.
  • I have a public key whose fingerprint is 1707 E5E0 F008 2BDB FA7B 48C3 2052 14E9 7B71 9962

To claim this, I am signing this object:

@Jegp
Jegp / Applet.html
Created July 29, 2012 11:40
Java Applet deployment in HTML
<html>
<body>
<!-- See this link for explanation: http://docs.oracle.com/javase/1.5.0/docs/guide/plugin/developer_guide/using_tags.html -->
<object classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA">
<param name="code" value="AppletTest.class">
<comment>
<embed code="AppletTest.class"
type="application/x-java-applet;jpi-version=1.7.0">
<noembed>
No Java Support.
@Jegp
Jegp / gist:3247871
Created August 3, 2012 13:49
How to draw in Siigna
// Create an image
val image = new BufferedImage(100, 100, BufferedImage.TYPE_3BYTE_BGR)
// Retrieve graphics
val graphics = image.getGraphics.asInstanceOf[Graphics2D]
// Convert to siigna graphics (much nicer API)
val siignaGraphics = new com.siigna.app.view.Graphics(graphics.asInstanceOf[Graphics2D])
@Jegp
Jegp / Remote.scala
Created October 24, 2012 11:18
How to create a listening server in scala
import scala.actors.Actor._
import scala.actors.remote._
import scala.actors.remote.RemoteActor._
object Remote {
val listening = actor {
alive(6001)
register('AwesomeRemoteServer, self)
println("I'm alive!")
@Jegp
Jegp / MyController.scala
Last active December 18, 2015 05:19
Using JS routes in Playframework 2.x (Scala)
package controllers
object MyController extends Controller {
def add() = Action { implicit request =>
Form( tuple ( "user" -> number ) ).bindFromRequest.fold(
errors => BadRequest,
t => {
Ok("Add id: " + t)
}
@Jegp
Jegp / jenkins_install.sh
Created September 11, 2016 19:41
A jenkins installation script
#!/bin/bash
##
## This script installs jenkins on debian based machines
## Author: Jegp <jensegholm@protonmail.com>
##
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
@Jegp
Jegp / presentation.html
Created November 10, 2016 17:21
Single page .html template for reveal.js presentations
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.3.0/css/reveal.min.css" type="text/css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.3.0/css/theme/white.min.css" type="text/css"/>
</head>
<body>
<div class="reveal">