Skip to content

Instantly share code, notes, and snippets.

View X4's full-sized avatar
:shipit:
❯ Building Some Capital

X4 X4

:shipit:
❯ Building Some Capital
  • (𝙰𝙸, 𝙲𝙼𝙿𝚁𝚂𝚂𝙽, 𝙲𝚛𝚢𝚙𝚝𝚘)
  • Dubai, UAW
  • 10:30 (UTC +04:00)
  • X @X4AES
  • X @SomeCapitalX
View GitHub Profile
doctype 5
html(lang='de')
head
meta(charset='utf-8')
meta(name='description', content='')
meta(name='viewport', content='width=device-width, initial-scale=1.0')
title website-title
link(href='stylesheets/normalize.css', rel='stylesheet', media='all')
@X4
X4 / fix-koala
Last active January 4, 2016 18:39
Generic LD_LIBRARY_PATH override wrapper used for https://github.com/oklai/koala/issues/161 to fix koala's nodewebkit issue complaining that libudev.so.0 is missing.
#!/bin/bash
# @author X4
# @date 2014-28-01
# This makes my life easier, when people use outdated shared libraries
BIN="${BASH_SOURCE##*-}"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SHARED_LIB="libudev.so.0"
SHARED_SOURCE="/opt/google/chrome/"
@X4
X4 / appendix.tex
Created December 2, 2013 21:40
LaTeX: Formats the Appendix to the form of: A.1, B.1, B.2.1
\documentclass{book}
\usepackage[toc,title,page]{appendix}
\begin{document}
\tableofcontents
\appendix
\renewcommand{\thesection}{\Alph{section}.\arabic{section}}
\setcounter{section}{0}
@X4
X4 / Thesis.tex
Last active December 26, 2015 21:09
Thesis Master Template
%&Thesis
% Create a binary preamble:
% fmtutil --byfmt pdflatex
% check for mistakes in the code
\RequirePackage[l2tabu, orthodox]{nag}
% permit Computer Modern fonts at arbitrary sizes.
\RequirePackage{fix-cm}
@X4
X4 / gentoo-rebel.xml
Created October 15, 2013 10:47
git clone https://gist.github.com/6989788.git /etc/layman/overlays/gentoo-rebel
<?xml version="1.0" encoding="UTF-8"?>
<layman>
<overlay contact="" name="gentoo-rebel" src="git://github.com/X4/gentoo-rebel.git" type="git">
<link>
http://github.com/X4/gentoo-rebel
</link>
<description>
Rebel Gentoo Overlay
</description>
</overlay>
@X4
X4 / autocomplete.zsh
Last active July 28, 2025 17:40
some zsh modules
#
# Sets completion options.
#
# Load and initialize the completion system ignoring insecure directories.
zmodload zsh/complist
autoload -Uz compinit && compinit -i
autoload -U colors ; colors
zle -C complete-menu menu-select _generic
@X4
X4 / flattenMatrix().cs
Last active December 19, 2015 11:49
Converting example using yield and the iterator approach to a basic loop or using LINQ.
// Your current code
public static IEnumerable<T> Flatten<T>(this T[,] matrix)
{
var rows = matrix.GetLength(0);
var cols = matrix.GetLength(1);
for (var i = 0; i < rows;i++ )
{
for (var j = 0; j < cols; j++ )
yield return matrix[i, j];
}
@X4
X4 / git-mysql-howto.md
Last active December 19, 2015 06:49
Git Dude and Git MySQL HowTo https://github.com/sickill/git-dude

Hi!

I have lots of repositories locally and on my servers, but I follow even more repositories and I contribute to some here and there. That's why I've the need to stay notified when there is a change. But I don't want to actively follow through RSS or E-Mail. A commit notification isn't worth bloating my inbox even more.

For those who don't know, there is a cool way to keep notified of commits etc. and to exchange messages. You can use IRC in combination with a git hook through cia.vc/ or github.com/ itself, even bitbucket.org supports it now. Otherwise just setup an eggdrop, supybot or the phergie IRC Bot and write a script for it. You can share it here if you want.

It's obvious that a snapshot of your application only makes sense when you also add a database snapshot to it. That's why I'll explain howto create a git hook to take database dumps on each commit or tag.

GIT based Database version control.

Go to the hidden .git folder in your project, then a sub folder in there called hooks

@X4
X4 / imgtoedj.sh
Last active December 15, 2015 13:38 — forked from tomoe-mami/imgtoedj.sh
#!/bin/sh
set -e
# Set the path to your own wallpaper directory
WALLPAPER_PATH="$HOME/Bilder/Sample Pictures"
NEXT_WALLPAPER="$HOME/Bilder/Sample Pictures/006.jpg"
FILENAME="006.jpg"
OUTPUT_DIR="$HOME/.e/e/backgrounds"
TEMPLATE='
#!/bin/bash
set -e
WALLPAPER_PATH="$HOME/Bilder/Sample Pictures/"
create_queue() {
find $WALLPAPER_PATH -type f -iregex '.*\.\(jpg\|gif\|png\|jpeg\)$' > /tmp/krawall_queue
}
shuffle_wallpapers() {