Skip to content

Instantly share code, notes, and snippets.

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)
#include "apue.h"
#include <dirent.h>
int
main(int argc, char *argv[])
{
DIR *dp;
struct dirent *dirp;
if (argc != 2)
@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
@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>

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

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

package com.manning.gia.todo.repository;
import com.manning.gia.todo.model.ToDoItem;
import org.junit.Before;
import org.junit.Test;
import java.util.List;
import static org.junit.Assert.*;