Skip to content

Instantly share code, notes, and snippets.

View wiesson's full-sized avatar

Arne Wiese wiesson

View GitHub Profile
@barryvdh
barryvdh / _ide_helper.php
Last active October 12, 2024 09:51
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@katowulf
katowulf / jwtparser.js
Last active September 19, 2017 13:11
Deconstruct a JWT token for Firebase
// Helper function to extract claims from a JWT. Does *not* verify the
// validity of the token.
// credits: https://github.com/firebase/angularFire/blob/master/angularFire.js#L370
// polyfill window.atob() for IE8: https://github.com/davidchambers/Base64.js
// or really fast Base64 by Fred Palmer: https://code.google.com/p/javascriptbase64/
function deconstructJWT(token) {
var segments = token.split(".");
if (!segments instanceof Array || segments.length !== 3) {
throw new Error("Invalid JWT");
}
@pheraph
pheraph / backup-uberspace.sh
Last active January 24, 2017 19:21
Eine lokale Sicherung eines oder aller uberspace(s) erstellen
#!/bin/sh
#
# Erstellt eine lokale Sicherung von /home/username, /var/www/virtual/username und der Datenbanken des Benutzers
#
# Voraussetzungen:
# Auf dem lokalen Computer sind die uberspaces in ~/.ssh/config wie folgt konfiguriert:
# Host uberspacename
# HostName sternenkonstellation.uberspace.de
# User uberspacename
#
@Luzifer
Luzifer / check_uberspace_balance.py
Last active August 5, 2018 20:01
Simple inofficial library to fetch Uberspace account data for monitoring money on account or whatever…
#!/usr/bin/env python2.7
from uberspace import *
import argparse, sys, math
ST_OK = 0
ST_WARN = 1
ST_CRIT = 2
ST_UNKN = 3
@jkbrzt
jkbrzt / pyc
Last active June 6, 2023 14:59
Delete Python's compiled *.pyc files like a pro
#!/bin/sh
#
# Delete Python's compiled *.pyc and __pycache__ files like a pro
# https://gist.github.com/jakubroztocil/7892597
#
# Usage:
# Delele *.pyc and __pycache__ files recursively in the current directory:
# $ pyc
#
# The same, but under /path:
#!/usr/bin/env python
# Quick and dirty demonstration of CVE-2014-0160 by
# Jared Stafford (jspenguin@jspenguin.org)
# Modified so that it finds cookies
import sys
import struct
import socket
import time
import select
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active October 15, 2024 08:07
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@bsphere
bsphere / timestamp.go
Last active January 23, 2024 02:50
UNIX timestamps in Golang
package timestamp
import (
"fmt"
"labix.org/v2/mgo/bson"
"strconv"
"time"
)
type Timestamp time.Time
@calebwoods
calebwoods / resize.rb
Last active October 24, 2017 11:41
Script for resizing a directory of images using Ruby. Note requires the RMagick gem to be installed and assumes Rbenv is used for managing the Ruby Version. Blog post: http://www.calebwoods.com/2015/02/01/batch-resizing-images-ruby/
#!/usr/bin/ruby
require 'RMagick'
require 'pathname'
@directory = Pathname(File.expand_path(ARGV[0]))
@size = ARGV.fetch(1) { 1025 }
def resize_image(file)
img = Magick::Image.read(file).first
@Stubbs
Stubbs / main.yml
Created March 28, 2015 14:31
Ansible Playbook to install PHP7
- name: Install Packages Needed To Compile PHP 7
apt: pkg={{ item }} state=latest
with_items:
- git
- autoconf
- bison
- libxml2-dev
- libbz2-dev
- libmcrypt-dev
- libcurl4-openssl-dev