Skip to content

Instantly share code, notes, and snippets.

#include "apue.h"
#include <dirent.h>
int
main(int argc, char *argv[])
{
DIR *dp;
struct dirent *dirp;
if (argc != 2)
@Batou99
Batou99 / apue.h
Created April 11, 2011 14:00
apue.h
/* Our own header, to be included before all standard system headers */
#ifndef _APUE_H
#define _APUE_H
#if defined(SOLARIS)
#define _XOPEN_SOURCE 500 /* Single UNIX Specification, Version 2 for Solaris 9 */
#define CMSG_LEN(x) _CMSG_DATA_ALIGN(sizeof(struct cmsghdr)+(x))
#elif !defined(BSD)
#define _XOPEN_SOURCE 600 /* Single UNIX Specification, Version 3 */
@Batou99
Batou99 / vim.rb
Last active December 10, 2015 15:39 — forked from mgrouchy/vim.rb
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331'
version '7.3.515'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

from locust import HttpLocust, TaskSet, task
from random import randint
class UserBehavior(TaskSet):
HEADERS = { "Accept": "application/vnd.myvendor+json; version=2" }
TOPICS = [452, 459, 460, 461, 462, 467, 470, 477, 479, 521, 524, 582, 591, 609, 506, 510, 513, 514, 515, 520, 525, 526, 527, 529, 530, 531, 532, 133, 282, 429]
@task(2)
def topics(self):
page = randint(1,10)
@Batou99
Batou99 / CDN Kit
Created December 15, 2015 11:05 — forked from 0frasure/CDN Kit
CDN Kit
<!-- Bootstrap -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<!-- Font Awesome -->
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Bootlint-->
<script src="//maxcdn.bootstrapcdn.com/bootlint/0.11.0/bootlint.min.js"></script>
defmodule Flatten do
def flatten([]), do: []
def flatten([head | tail]), do: flatten(head) ++ flatten(tail)
def flatten(x), do: [x]
end
defmodule FlattenTest do
use ExUnit.Case
defmodule MyList do
def flatten([]), do: []
def flatten([head | tail]), do: flatten(head) ++ flatten(tail)
def flatten(x), do: [x]
end
defmodule MyListTest do
use ExUnit.Case

Steps to update the CHANGELOG

  1. When branching out, edit the CHANGELOG.md and add an "Unreleased" section on top
  2. The section will have subsections (in needed) for
    • Added
    • Changed
    • Deprecated
    • Removed
    • Fixed
    • Security

Why

Keeping a changelog and tagging the releases serve various purposes

Easy identification

It's easy to identify the differences between versions (e.g. Production vs Staging) so everyone is aware of what is running at a server just looking at the CHANGELOG.md

Helping the Product Team

Sometimes the product team may not be fully aware of what are we deploying or what the differences are between what is deployed vs what we are testing. The CHANGELOG.md will be easier to understand than checking commit messages. Commit messages are much more technical oriented and written for developers instead of customers/managers.

Visibility