Skip to content

Instantly share code, notes, and snippets.

View strycore's full-sized avatar
:shipit:
Founder of Lutris, the open gaming platform for Linux.

Mathieu Comandon strycore

:shipit:
Founder of Lutris, the open gaming platform for Linux.
View GitHub Profile
@strycore
strycore / lifesupport-unplug.py
Created February 22, 2011 21:37
unplug life support
#!/usr/bin/python
import time
import os.path
while True:
if not os.path.exists("/dev/input/js0"):
break
else:
# Do stuff here
@strycore
strycore / build-gimp-git.sh
Created April 5, 2012 10:40
Gimp git installer script for Ubuntu
#!/bin/bash
# Resources
# http://www.gimpusers.com/tutorials/compiling-gimp-for-ubuntu
# http://ubuntuforums.org/showthread.php?p=11818979
#
sudo apt-get build-dep gimp
sudo apt-get install libjpeg62-dev libopenexr-dev librsvg2-dev libtiff4-dev
mkdir gimp_build && cd gimp_build
@strycore
strycore / setup.sh
Last active November 28, 2020 05:59
Setup script for installing Terraria on Ubuntu
#!/bin/bash
# installing dependencies
dependencies="libmonogame-cil ffmpeg mmv libopenal1 zenity"
install_deps=0
for package in $dependencies; do
echo $package
dpkg -s $package | grep installed
if [ $? == 0 ]; then
install_deps=1
@strycore
strycore / vdf_parser.py
Created June 8, 2013 15:18
Parser for Steam VDF files
import os
import json
def vdf_parse(steam_config_file, config):
line = " "
while line:
line = steam_config_file.readline()
if not line or line.strip() == "}":
return config
@strycore
strycore / designer.html
Last active August 29, 2015 14:16
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
@strycore
strycore / mailbot.py
Created August 21, 2016 08:07
Download emails from an imap folder
#!/usr/bin/python3
import os
import ssl
import imaplib
from configparser import ConfigParser
config_path = os.path.expanduser('~/.mailbot.conf')
parser = ConfigParser()
parser.read(config_path)
@strycore
strycore / setlayout.py
Last active September 17, 2016 19:40
Test layout switching in python
import os
import time
import subprocess
print("Set layout to 'us'")
setxkbmap_command = ['setxkbmap', '-model', 'pc101', 'us', '-print']
xkbcomp_command = ['xkbcomp', '-', os.environ.get('DISPLAY', ':0')]
xkbcomp = subprocess.Popen(xkbcomp_command, env=os.environ, stdin=subprocess.PIPE).stdin
subprocess.Popen(setxkbmap_command,
@strycore
strycore / shuffle.js
Created February 7, 2017 06:55
Shuffle
function getRandom(arr, lastIndex) {
var index, size, distance;
size = arr.length;
do {
index = parseInt(Math.random() * size);
distance = Math.abs(index - lastIndex);
} while(size > 5 && distance < size / 3);
return index;
}
@strycore
strycore / radar.html
Created March 22, 2017 16:38
Canvas radar
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Index</title>
<style type="text/css" media="screen">
body {
background-color: #333;
text-align: center;
@strycore
strycore / egghead-redux.py
Created April 3, 2017 01:55
Download the videos from Egghead.io Redux courses
import requests
import subprocess
from urllib.parse import urlparse
from bs4 import BeautifulSoup
main_url = "https://egghead.io/courses/getting-started-with-redux"
response = requests.get(main_url)
soup = BeautifulSoup(response.content, 'html.parser')