Skip to content

Instantly share code, notes, and snippets.

View jhbruhn's full-sized avatar
energized

Jan-Henrik Bruhn jhbruhn

energized
View GitHub Profile
@jhbruhn
jhbruhn / electron-launcher.sh
Last active December 7, 2020 17:31
Electron launcher to pass command line flags from Home Config
#!/bin/sh
CONFIG_DIR=${XDG_CONFIG_HOME:-$HOME/.config}
CONFIG_FILE=$CONFIG_DIR/electron-flags.conf
xargs -a $CONFIG_FILE /usr/lib/electron/electron $@ || /usr/lib/electron/electron $@
# Script generated with create_pkgbuild.py
# For more information: https://github.com/ros-melodic-arch/ros-build-tools-py3
pkgdesc="ROS - Provides a cmake config for the default version of Gazebo for the ROS distribution."
url='http://gazebosim.org/tutorials?cat=connect_ros'
pkgname='ros-melodic-gazebo-dev'
pkgver='2.8.6'
arch=('any')
pkgrel=1
license=('Apache 2.0')
for(int i = 0; i < 10; i+=3) {
//...
i -= 2;
//...
}
@jhbruhn
jhbruhn / SConstruct
Last active December 20, 2015 03:09
POCA!1!!1! build with scons
env = Environment() #init env
poca = env.Program(target = 'poca', source = ['poca.c', 'vector.c'], LIBS=['ncurses', 'form']) #build POCA
# install POCA
env.Install("/usr/local/bin", poca)
env.Alias('install', ['/usr/local/bin'])
el:"", //Feed-Item-List
events: { 'scroll': 'checkScroll' },
checkScroll: function () {
var triggerPoint = 100; // 100px from the bottom
if( !this.isLoading && this.el.scrollTop + this.el.clientHeight + triggerPoint > this.el.scrollHeight ) {
this.addPage(); //oderso
}
}
@jhbruhn
jhbruhn / puushload.rb
Last active December 12, 2015 08:58
Download "All" Puush.me-files in a crappy way (but it works, yay!) requires 'trollop' gem
require 'net/http'
require 'fileutils'
require 'logger'
require 'trollop'
CHARS = ("0".."9").to_a + ("a".."z").to_a + ("A".."Z").to_a
opts = Trollop::options do
opt :output_dir, "Output-Directory", :short => 'o', :default => "files", :type => String
opt :log_file, "Logfile-Path", :short => 'l', :default => "STDOUT", :type => String
package org.alternadev.brainfuck;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
@jhbruhn
jhbruhn / main.lua
Created December 26, 2012 23:38
Löve ist ja schon nais
paddleWidth = 10*2
paddleHeight = 200
ballRadius = 10
width = 800
height = 600
function love.load()
love.physics.setMeter(64)
world = love.physics.newWorld(0, 0, true)
@jhbruhn
jhbruhn / karl.rb
Created September 22, 2012 19:44
Worst code evar
message.is_a LoginMessage ? @client.puts(JSON LoginResponseMessage.new) if message.validate_login : @client.close
@jhbruhn
jhbruhn / Heinz.md
Created August 7, 2012 14:58
An example

Good evening ladies and gentlemen. I am an example-gist which has just one purpose: be an example. I bet you didn't know this before!

I am a heading!

Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass.

Idea

Basically, this idea was stolen from gist.io but I was bored so I rewrote it with Node.js. Here's a list of colors (in german):

  • Rot