Skip to content

Instantly share code, notes, and snippets.

View jakubpawlowicz's full-sized avatar

Jakub Pawlowicz jakubpawlowicz

View GitHub Profile
@jakubpawlowicz
jakubpawlowicz / README.md
Created November 14, 2023 11:02
Elixir script fixing indentation by replacing leading tabs with spaces

Usage

elixir fix.exs glob/wildcard/pattern

e.g.

elixir fix.exs project/\*\*/\*.eex
@jakubpawlowicz
jakubpawlowicz / Readme.md
Last active February 18, 2022 13:26
Simple Serum (https://dalgona.github.io/Serum/) plugin building RSS of latest posts.

Simple Serum plugin building RSS of latest posts.

Put rss_generator.ex under lib, rss.xml.eex under pages and add RssGenerator to plugins in your serum.exs file.

You may also need to add elixirc_paths: ["lib"] inside mix.exs's project, so Elixir knows it has to compile lib, which is not the Serum's default.

Important!: don't forget to customize the RSS title, description, URL's etc in rss.xml.eex.

p.s. It's code adapted from an unmerged Serum PR

<p style="color:red;color:green\0">\0 suffix hack: green in IE, red everywhere else</p>
<p style="color:red;color:green\9">\9 suffix hack: green in older IE (up to 9 or 10, not sure which), red everywhere else (including IE 11)</p>
---
layout: default
title: Terms & Conditions
body_class: terms
---
<section class='section content'>
<div class='container group'>
<h1 class='motto'>Terms of service</h1>
<div class='full'>
@jakubpawlowicz
jakubpawlowicz / configuration.nix
Created December 5, 2018 14:40
How to add brotli module to nginx under NixOS
{ config, pkgs, ... }:
{
nixpkgs.overlays = [
(self: super: {
nginxStable = super.nginxStable.override {
modules = [
self.nginxModules.brotli
];
};
@jakubpawlowicz
jakubpawlowicz / brunch.js
Created June 6, 2016 11:04
Brunch setup to output more than one CSS and JS file
exports.config = {
files: {
javascripts: {
joinTo: {
'js/app.js': [
'web/static/js/vendor/**/*.js',
'web/static/js/app/*.js'
],
'js/dashboard.js': [
'web/static/js/vendor/**/*.js',
@jakubpawlowicz
jakubpawlowicz / Dockerfile
Created March 1, 2015 22:36
Docker + CentOS 7 + Rubinius 2.2.10
FROM centos:7
ENV RBX_VERSION 2.2.10
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV HOME /root
ENV SHELL /bin/bash
@jakubpawlowicz
jakubpawlowicz / gist:6fa7465b323486e8b89d
Created February 22, 2015 16:22
Regex matching single- and multiline CSS comments in Sublime Text
/\*((?!\*/).|\n)+\*/
@jakubpawlowicz
jakubpawlowicz / Vagrantfile
Created January 6, 2015 12:25
Vagrantfile template for a higher performant VM
Vagrant.configure('2') do |config|
config.ssh.forward_agent = true
config.vm.provider 'virtualbox' do |vb|
vb.customize ['modifyvm', :id, '--memory', '2048']
vb.customize ['modifyvm', :id, '--cpus', 4]
vb.customize ['modifyvm', :id, '--ioapic', 'on']
vb.customize ['modifyvm', :id, '--natdnsproxy1', 'off']
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'off']
end
@jakubpawlowicz
jakubpawlowicz / capistrano current branch
Created October 6, 2010 17:37
Allows deploying current branch via Capistrano without altering deployment configuration on every branch
set :branch, `git branch 2> /dev/null`.scan(/\* (\S+)/).flatten[0]