This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void update(float deltaTime) { | |
/* glClear etc... */ | |
// mapCamera is an OrthogonalCamera | |
mapCamera.position.set(cameraMovable.position.x * mapComponent.pixelsPerMeter, | |
cameraMovable.position.y * mapComponent.pixelsPerMeter, 0); | |
mapCamera.zoom = 1.0f/cameraComponent.camera_zoom; | |
mapCamera.update(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// apply steering behaviors | |
ImmutableArray<Entity> entities = engine.getEntitiesFor(Family.getFor(SteerAgentComponent.class)); | |
for(int i = 0; i < entities.size(); i++) { | |
Entity e = entities.get(i); | |
Body body = e.getComponent(PhysicalBodyComponent.class).body; | |
SteerAgentComponent steer = e.getComponent(SteerAgentComponent.class); | |
if(steer.steeringBehavior == null) { | |
continue; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os, sys | |
# This script expects the following folder structure: | |
# / the folder you run this script from | |
# /in store the videos which you want to rip here | |
# /out the extracted audio will be written here | |
# as Ogg files, using the same name as the input | |
# /done and the videos that were in in/ will be moved here. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
year=$(date +%Y) | |
month=$(date +%m) | |
day=$(date +%d) | |
xdg-open https://d1ejxu6vysztl5.cloudfront.net/comics/garfield/${year}/${year}-${month}-${day}.gif | |
# if you're on Mac, use open instead of xdg-open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -o pipefail | |
start=$1 | |
stop=$2 | |
delay=$3 | |
for rev in $(git log --oneline ${start}..${stop} |tac |cut -d' ' -f1); do | |
git cherry-pick -n ${rev} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { // list all css classes referred to in the document | |
const classes = new Set(); | |
function findClasses(el) { | |
if(el.hasAttribute('class')) { | |
const cls = el.getAttribute('class').split(' '); | |
for(let cl of cls) { | |
classes.add(cl); | |
} | |
} | |
for(let child of el.children) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import vobject | |
import re | |
import sys | |
# TODO gérer les entrées qui contiennent plus d'un numéro de téléphone, ou au moins écrire un warning | |
vcf = "".join(open(sys.argv[1]).readlines()).strip() | |
vcfs = [e for e in vcf.split("END:VCARD") if e != ""] | |
vcfs = [e+"END:VCARD" for e in vcfs] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import codecs | |
# Recursively rename files or folders from iso-8859-1 to utf-8 | |
def rename_to_utf8(directory, what): | |
for root, dirs, files in os.walk(directory): | |
for filename in (dirs if what == "dirs" else files): | |
old_path = os.path.join(root, filename) | |
# Decode the old filename from iso-8859-1 |