Skip to content

Instantly share code, notes, and snippets.

The Freenode resignation FAQ, or: "what the fuck is going on?"

IMPORTANT NOTE:

It's come to my attention that some people have been spamming issue trackers with a link to this gist. While it's a good idea to inform people of the situation in principle, please do not do this. By all means spread the word in the communities that you are a part of, after verifying that they are not aware yet, but unsolicited spam is not helpful. It will just frustrate people.

Update 3 (May 24, 2021)

A number of things have happened since the last update.

@hkoba
hkoba / sched-reboot.service
Last active November 6, 2023 16:07
systemd service and timer for scheduled reboot.
[Unit]
Description=Scheduled Reboot
[Service]
Type=simple
ExecStart=/usr/bin/systemctl --force reboot
anonymous
anonymous / i18n.js
Created June 23, 2016 08:07
var i18nModule = angular.module('i18nModule', []);
i18nModule.factory('i18n', function() {
var tokenRE = /\$\{(?:(?:(\d+)|([a-z_][\w\-]*))(?::([a-z_\.]+)(?:\(([^\)]*?)?\))?)?)\}/gi;
var evaluate = function(text, values) {
var fn = function(match, index, name, formatFn, args) {
if (name === null || name === '') {
name = index;
}
if (values[name]) {
@thisismitch
thisismitch / dropbox
Last active March 26, 2018 02:13 — forked from kbrnsr/dropbox
Dropbox systemd and init files (CentOS 7)
#!/bin/sh
# To configure, add line with DROPBOX_USERS="user1 user2" to /etc/sysconfig/dropbox
# Probably should use a dropbox group in /etc/groups instead.
# Source function library.
. /etc/rc.d/init.d/functions
prog=dropboxd
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active April 26, 2024 09:25
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@mmerickel
mmerickel / static.py
Last active July 11, 2016 07:48
static asset detection
class StaticFactory(object):
def __init__(self, request):
request.is_static_asset = True
config.add_static_view('static', static_pkg, factory=StaticFactory)
config.add_request_method(lambda r: False, 'is_static_asset', reify=True)
_default_vary = set([
'Cookie',
'Accept',
@mmerickel
mmerickel / security.py
Last active October 9, 2015 15:57
simple token-based authentication policy
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.security import (
Authenticated,
Everyone,
)
log = __import__('logging').getLogger(__name__)
class OAuthAuthenticationPolicy(object):
def unauthenticated_userid(self, request):
@sebmarkbage
sebmarkbage / react-terminology.md
Last active January 9, 2023 22:47
React (Virtual) DOM Terminology
@randomphrase
randomphrase / cmdoptions.cpp
Last active February 17, 2023 05:51
Demonstration of how to do subcommand option processing with boost program_options
#define BOOST_TEST_MODULE subcommand options
#include <boost/test/unit_test.hpp>
#include <boost/program_options.hpp>
#include <boost/variant/variant.hpp>
#include <boost/variant/get.hpp>
struct GenericOptions {
bool debug_;
};
@ax3l
ax3l / CUDA_Compilers.md
Last active May 3, 2024 13:36
CUDA Compilers