Skip to content

Instantly share code, notes, and snippets.

xenogenesi

Block or report user

Report or block xenogenesi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bootstrap3.3.6-mobile-only.min.css
/*!
* Bootstrap v3.3.6 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-si
@xenogenesi
xenogenesi / vlc-ffmpeg-thumbnail.lua
Last active Apr 17, 2019
lua extension for vlc to generate thumbnail of the current frame using ffmpeg
View vlc-ffmpeg-thumbnail.lua
-- generate thumbnail jpeg of the current selected frame using ffmpeg
-- name convention for minidlna or synology
-- install in ~/.local/share/vlc/lua/extensions/Thumbnail2.lua
-- tested on linux only
function descriptor()
return {
title = "Thumbnail2 generator";
@xenogenesi
xenogenesi / Makefile
Last active Jul 15, 2019
create self signed certificates
View Makefile
DOMAIN ?= mydomain.com
COUNTRY := IT
STATE := IT
COMPANY := Evil Corp.
# credits to: https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309
# usage:
@xenogenesi
xenogenesi / apiresponsebool.diff
Created May 11, 2018
fix meinside/telegram-bot-go's EditMessageText response
View apiresponsebool.diff
diff --git a/methods.go b/methods.go
index 55a6eca..7c997a7 100644
--- a/methods.go
+++ b/methods.go
@@ -723,7 +723,7 @@ func (b *Bot) AnswerCallbackQuery(callbackQueryID string, options map[string]int
// other options: parse_mode, disable_web_page_preview, and reply_markup
//
// https://core.telegram.org/bots/api#editmessagetext
-func (b *Bot) EditMessageText(text string, options map[string]interface{}) (result APIResponseMessage) {
+func (b *Bot) EditMessageText(text string, options map[string]interface{}) (result APIResponseBool) {
@xenogenesi
xenogenesi / gimp-layers-slice.py
Last active Aug 16, 2017
gimp py fu console script: from an image with multiple layers, cut and save each layer by transparency saving the coordinates into a json file
View gimp-layers-slice.py
# from gimp py fu console
# execfile("/path/to/this-script.py")
# for each layer use magic wand at pixel 1,1 (assume it is transparent), and create a selection, inverse it, transform to rectangle bounding box
# copy it and paste into a new image, save as png (and save the original coordinates into a json { "layer-name": [ x1, y1, x2, y2 ] }
from array import array
savepath="/tmp/slices/"
f = open("{0}images.json".format(savepath), "w")
@xenogenesi
xenogenesi / phing.find_relative_path.xml
Last active Jul 31, 2017 — forked from ohaal/find_relative_path.func.php
Phing AdhocTask to find the relative path between two paths
View phing.find_relative_path.xml
<!--
Usage:
<relative-path from="${from}" to="${to}"
output="project_property" />
-->
<adhoc-task name="relative-path"><![CDATA[
class RelativePath extends Task {
private $from;
private $to;
private $output;
View actionMigrateUp.php
<?php
public function actionMigrateUp()
{
// https://github.com/samdark/yii2-webshell
// https://github.com/samdark/yii2-webshell/issues/3
// https://github.com/tebazil/yii2-console-runner/blob/master/src/ConsoleCommandRunner.php
// https://stackoverflow.com/a/28820239/2498790
/* // if exec() is available
@xenogenesi
xenogenesi / apt-local-mirror.sh
Created Jul 7, 2017
shell script to mirror locally a subset of packages from an external repository
View apt-local-mirror.sh
#!/bin/sh -e
# - create a root directory (into /var/local or similar, eg: apt-repos/)
# - create a somerepo.conf file (will be sourced by this script)
#
# # _URL+_DIR is the path to download the source Packages.gz
# # "Filename:" in Packages is relative to _URL (eg: _URL/pool/...)
# SRC_REPO_URL="http://some-url"
# SRC_REPO_DIR="dists/sid/main/binary-amd64"
#
@xenogenesi
xenogenesi / fbpanel-sysmenu-dot-desktop-term.diff
Created Jan 8, 2017
fbpanel patch to enable terminal commands in system-menu plugin from .desktop files
View fbpanel-sysmenu-dot-desktop-term.diff
--- a/plugins/menu/system_menu.c
+++ b/plugins/menu/system_menu.c
@@ -4,6 +4,10 @@
#include <glib/gstdio.h>
#include <string.h>
#include <time.h>
+#define PREPEND_TERMINAL
+#ifdef PREPEND_TERMINAL
+#include <stdlib.h>
+#endif
View my-fancy-zsh-prompt.sh
myprompt_precmd() {
setopt noxtrace noksharrays localoptions
local exitstatus=$?
local git_dir git_ref
psvar=()
[[ $exitstatus -ge 128 ]] && psvar[1]=" $signals[$exitstatus-127]" || psvar[1]=""
local TERMWIDTH
(( TERMWIDTH = ${COLUMNS} - 1 ))
You can’t perform that action at this time.