Skip to content

Instantly share code, notes, and snippets.

View fwoelffel's full-sized avatar

Frédéric Woelffel fwoelffel

View GitHub Profile
@Agurri
Agurri / freenas.sr.help.fix.txt
Last active January 20, 2020 17:15
FreeNAS Sickrage - Help & Info Web Page Fix
After switching to the new repo and updating, I lost the ability to see the SickRage Version, branch and commit on the Help & Info page. After trying seveal methods, I've came down to this ... It might not be the only way to do it, but it worked for me as of today (01/29/2016)
Credits go to neoatomic and delfrogo (https://forums.freenas.org/index.php?threads/new-sickrage-repo.39368/)
Step 1.
Do a backup with the Sickrage GUI. The procedure should not break anything but let's be cautious.
Step 2.
Stop Sickrage plugin in the FreeNAS GUI by going in Plugins, Installed, Stop.
@mamantoha
mamantoha / experience.rb
Last active April 13, 2025 08:50
Rails API Filtering and Sorting
# app/models/experience.rb
#
# == Schema Information
#
# Table name: experiences
#
# id :integer not null, primary key
# title :string
# description :text
# created_at :datetime not null
@carlhoerberg
carlhoerberg / reconnect.js
Created May 13, 2015 14:45
How to build reconnect logic for amqplib
var amqp = require('amqplib/callback_api');
// if the connection is closed or fails to be established at all, we will reconnect
var amqpConn = null;
function start() {
amqp.connect(process.env.CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) {
if (err) {
console.error("[AMQP]", err.message);
return setTimeout(start, 1000);
}
@allenwb
allenwb / 0Option2ConstructorSummary.md
Last active February 24, 2025 23:12
New ES6 constructor features and semantics: Alternative 2 manual super in derived classes

New ES6 Constructor Semantics and Usage Examples

Manual super: Alternative Design where subclass constructors do not automatically call superclass constructors

This Gist presents a new design of class-based object construction in ES6 that does not require use of the two-phase @@create protocol.

One of the characteristics of this proposal is that subclass constructors must explicitly super invoke their superclass's constructor if they wish to use the base class' object allocation and initialization logic.

An alternative version of this design automatically invokes the base constructor in most situations.

@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);