Skip to content

Instantly share code, notes, and snippets.

View confususs's full-sized avatar

Ard Timmerman confususs

  • Groningen, The Netherlands
View GitHub Profile
@confususs
confususs / rename_binary.nix
Created April 7, 2021 19:05
How to use ffmpeg when I call avconv
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
avconv = runCommand "avconv" {
buildInputs = [ makeWrapper ];
} ''
mkdir $out
ln -s ${ffmpeg}/* $out
rm $out/bin
mkdir $out/bin
@confususs
confususs / loop_hero.nix
Created March 16, 2021 20:09
Add the following to your configuration.nix to be able to play Loop Hero on NixOS :).
# Below patches steam with the right libraries so you can play
# Loop Hero. Have fun!
nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override {
extraPkgs = pkgs: [
pkgs.openssl_1_1
pkgs.libnghttp2
pkgs.libidn2
pkgs.rtmpdump
pkgs.libpsl
@confususs
confususs / tibia-launcher.nix
Last active September 3, 2019 16:12
nix derivation to get the launcher of the legendary MMORPG Tibia
with import <nixpkgs> {};
# { stdenv, dpkg, fetchurl, glibc, gcc-unwrapped, autoPatchelfHook, pkgs }:
let
# Please keep the version x.y.0.z and do not update to x.y.76.z because the
# source of the latter disappears much faster.
version = "11.0.0";
src = fetchurl {
url = "https://static.tibia.com/download/tibia.x64.tar.gz";
{ config, pkgs, ... }:
{
home.packages = with pkgs; [
arandr
spotify
oh-my-zsh
transmission
steam
peek
syntax on
filetype plugin indent on
" Random basic settings
let mapleader = "\<Space>"
set number " Always show line numbers
set nocompatible " No vi compatibility
set cursorline " Highlight current line
set so=5
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, vim_configurable, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
filetype off
" Plug setup
call plug#begin('~/.config/nvim/plugged')
" Linting & completion
Plug 'w0rp/ale'
Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}}
@confususs
confususs / getridoftry.py
Created January 23, 2016 15:02
How to get rid of try
dupl = []
for xyz in xyz_array:
try:
i = [y[0] for y in dupl].index(xyz[:-1])
except:
i = False
if not i:
dupl.append([xyz[:-1], xyz[2:], 1])
else:
dupl[i][1]+=xyz[2:]
data = {
"bills": [
{
"url": "http:\/\/maplight.org\/us-congress\/bill\/110-hr-195\/233677",
"jurisdiction": "us",
"session": "110",
"prefix": "H",
"number": "195",
"measure": "H.R. 195 (110\u003csup\u003eth\u003c\/sup\u003e)",
"topic": "Seniors' Health Care Freedom Act of 2007",
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#ifndef TYPEDEF_ENUM_BOOLEAN_DECLARED_
#define TYPEDEF_ENUM_BOOLEAN_DECLARED_
typedef enum{ false, true } boolean;
char* bool_print[] = {"no", "yes"};
#endif