Skip to content

Instantly share code, notes, and snippets.

View jnsdbr's full-sized avatar
👀
Whats up?

Jens jnsdbr

👀
Whats up?
View GitHub Profile
@jnsdbr
jnsdbr / q3_server.sh
Created September 22, 2012 00:24
GameServer Startup Script
#!/bin/sh
#
# This is a very old startup script for gameservers which can be easily modified
#
# What u need:
# screen
# awk
# Quake3 Files
#
# VARS:
@jnsdbr
jnsdbr / rotate.js
Created August 1, 2014 15:14
Rotating a sprite towards the mouse pointer in phaser.js
window.onload = function()
{
var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, '', {
preload: preload,
create: create,
update: update
});
var dragging = false;
#!/bin/sh
ffmpeg -i "movie.mp4" -c:v libx264 -preset ultrafast -crf 15 -r 30 -threads 8 -c:a copy "movie_new.mp4"
@jnsdbr
jnsdbr / resizeImages.sh
Created September 24, 2014 12:55
Image modifiers
#!/bin/bash
find . -type f -name "*.jpg" | while read line
do
dir=${line%/*}
file=${line/##*/}
file=${file}
convert "${file}" -resize 400 "resized/${file}"
done
@jnsdbr
jnsdbr / checkRetina.js
Created December 4, 2014 13:54
checkRetina.js
function displayIsRetina()
{
return (window.devicePixelRatio || (window.matchMedia && window.matchMedia("(min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 1.5),(-moz-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5)").matches? 2 : 1) || 1) > 1 ? true : false)
}
@jnsdbr
jnsdbr / readArduinoHTTPServer.py
Created January 31, 2015 19:25
The threading is dirty but it works.
import threading
import serial
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
value = 0
ser = serial.Serial('/dev/tty.usbmodemXYZ', 9600)
def read_value():
@jnsdbr
jnsdbr / fixSubPixel.js
Last active August 29, 2015 14:18
Fix subpixel rendering errors
fixSubPixel = function(container, elements) {
// Default columns
var cols = 2;
// Columns according to mediaqueries
if(container.width() > 1023)
{
cols = 4;
}
import java.awt.event.*;
import java.awt.Robot;
Robot bot = null;
int nextClick = (int)random(15, 50);
void setup() {
try {
bot = new Robot();
}
@jnsdbr
jnsdbr / gsap_slider.html
Created September 17, 2015 15:14
Simple Slider using GSAP
<html>
<head>
<title>Slider test</title>
<style>
* {
margin: 0;
padding: 0;
list-style: none;
box-sizing: border-box;
font-family: 'Roboto';
@jnsdbr
jnsdbr / particle-cli.md
Last active October 6, 2015 17:54
particle-cli installation after updating osx to 10.11

Xcode command line tools

xcode-select --install

Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Fancy stuff no one needs to know...

sudo npm install -g n
sudo n 0.10.36```