Skip to content

Instantly share code, notes, and snippets.

View rowanj's full-sized avatar
🐧
Seizing the machines of production

Rowan James rowanj

🐧
Seizing the machines of production
View GitHub Profile
diff --git a/boost/libs/filesystem/src/operations.cpp b/boost/libs/filesystem/src/operations.cpp
index 4114e02a..e663fabc 100644
--- a/boost/libs/filesystem/src/operations.cpp
+++ b/boost/libs/filesystem/src/operations.cpp
@@ -2169,8 +2169,6 @@ namespace
inline int readdir_r_simulator(DIR * dirp, struct dirent * entry,
struct dirent ** result)// *result set to 0 on end of directory
{
- errno = 0;
-
@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active January 20, 2024 12:57
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:

@toqueteos
toqueteos / sha1.go
Last active April 10, 2023 19:34
Minecraft player auth SHA-1 digest.
// You can test this online at: https://play.golang.org/p/hhayRT1VWgj
package main
import (
"crypto/sha1"
"encoding/hex"
"fmt"
"io"
"strings"
)
@rowanj
rowanj / SharedPtrEx.hpp
Created October 12, 2012 05:09
Shared pointer implementation that throws exceptions on NULL
//
// SharedPtrEx.hpp
// Phere Shared Ptr
//
// Created by Rowan James on 12/10/12.
// Copyright 2012 Rowan James. All rights reserved.
//
#ifndef PHERE_UTIL_SHARED_PTR_HPP
#define PHERE_UTIL_SHARED_PTR_HPP
@rowanj
rowanj / gist:1688354
Created January 27, 2012 11:25
Regex to match any decimal number in source files
([+-])?(0|[1-9][0-9]*)(?:\.([0-9]+))?(?:[Ee]([+-])?(0|[1-9][0-9]*)(?:\.([0-9]+))?)?
@rowanj
rowanj / dct_weak.h
Created December 29, 2011 01:01 — forked from Abizern/dct_weak.h
ARC macros for weak references
#ifndef _DCT_WEAK_H
#define _DCT_WEAK_H
// Macros for portable support of notionally weak properties with ARC
// Forked from https://gist.github.com/1354106
// Updated by Rowan James
// Available at https://gist.github.com/1530868
// Defines:
// dct_weak to be used as a replacement for the 'weak' keyword:
// @property (dct_weak) NSObject* propertyName;
@fmela
fmela / stacktrace.cxx
Last active September 22, 2023 10:58
A C++ function that produces a stack backtrace with demangled function & method names.
/*
* Copyright (c) 2009-2017, Farooq Mela
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
import XMonad
import XMonad.ManageHook
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.FadeInactive
import XMonad.Layout.Accordion
import XMonad.Layout.PerWorkspace