Skip to content

Instantly share code, notes, and snippets.

@jjb
jjb / file.md
Last active January 31, 2025 22:44
Using Jemalloc 5 with Ruby.md

For years, people have been using jemalloc with ruby. There were various benchmarks and discussions. Legend had it that Jemalloc 5 didn't work as well as Jemalloc 3.

Then, one day, hope appeared on the horizon. @wjordan offered a config for Jemalloc 5.

Ubuntu/Debian

FROM ruby:3.1.2-bullseye
RUN apt-get update ; \
@merlinmann
merlinmann / wisdom.md
Last active August 1, 2024 01:08
Merlin's Wisdom Project (Draft)

Merlin's Wisdom Project

Or: “Everybody likes being given a glass of water.”

By Merlin Mann.

It's only advice for you because it had to be advice for me.

// jshint esversion:6
(function() {
var app = Application('OmniFocus'); //This assumes that OmniFocus is installed on MacOS
app.includeStandardAdditions = true;
var doc = app.defaultDocument;
var content = doc.documentWindows.at(0).content;
var selectedTree = content.selectedTrees();
var selectedLen = selectedTree.length;
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active February 2, 2025 11:14
Hyperlinks in Terminal Emulators
@lamont-granquist
lamont-granquist / resources.md
Last active August 17, 2023 22:29
Three Ways to Write Correct Chef Resources

This has been moved into the official Chef docs:

https://docs.chef.io/custom_resources_notes.html

12.5 style custom resources

This is by far the most recommended way of writing resources for all users. There are two gotchas which we're working through:

  1. For helper functions that you used to write in your provider code or used to mixin to your provider code, you have to use an action_class do ... end block.
@juliandunn
juliandunn / packages.rb
Last active August 29, 2015 14:14
Refactored version of Chef RPM packages plugin; also expanded to handle dpkgs. Original source code: https://github.com/demonccc/chef-repo/blob/master/plugins/ohai/linux/rpm.rb
#
# Author:: Claudio Cesar Sanchez Tejeda <[email protected]>
# Author:: Julian C. Dunn <[email protected]>
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@ijonas
ijonas / Dockerfile
Last active December 25, 2015 10:19
MySQL Docker Files
# MySQL service
#
# Version 0.0.1
FROM ubuntu
MAINTAINER support@caseblocks
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
@kroger
kroger / mobi.py
Created June 26, 2013 11:37
Mobi builder based on Sphinx's epub builder.
# -*- coding: utf-8 -*-
"""
sphinx.builders.mobi
~~~~~~~~~~~~~~~~~~~~
Build mobi files.
Originally derived from epub.py.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
@ls-lukebowerman
ls-lukebowerman / sitemap.xml.erb
Created August 7, 2012 17:59
Sitemap (sitemaps.org) generator for Middleman
<% pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) } %>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<% pages.each do |p| %>
<url>
<loc>http://youdomain.com/<%=p.destination_path.gsub('/index.html','')%></loc>
<priority>0.7</priority>
</url>
<% end %>
</urlset>