Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
CTO at Spacefill

Stéphane Klein harobed

💭
CTO at Spacefill
View GitHub Profile
View install.sh
#!/usr/bin/env bash
# curl ... | bash
set -e
# make in case they aren't already there
mkdir -p "/usr/local/lib"
mkdir -p "/usr/local/bin"
# Check for Homebrew,
@harobed
harobed / ASS.md
Created Nov 30, 2018 — forked from klaaspieter/ASS.md
Acronyms Seriously Suck - Elon Musk
View ASS.md

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

@harobed
harobed / verbose.sh
Created Aug 4, 2018
Print a trace of commands in bash without variable expansion
View verbose.sh
#!/bin/bash
set -T
trap 'echo "> $BASH_COMMAND"' DEBUG
i=1234
echo "$i"
(echo $i)
@harobed
harobed / README.md
Created Dec 3, 2017
Merge git `project/repos-b` in `project/repos-a` in `repos-b` subdirectory:
View README.md

Merge project/repos-b in project/repos-a in repos-b subdirectory:

$ git clone git@example.com:project/repos-a.git
$ cd repos-a
$ git remote add -f repos-a git@example.com:project/repos-b.git
$ git merge -s ours --allow-unrelated-histories --no-commit repos-b/master
$ git read-tree --prefix=repos-b/ -u repos-b/master
$ git commit -m "Merge repos-b as our subdirectory"
$ git pull --allow-unrelated-histories -s subtree repos-b master
@harobed
harobed / README.md
Last active Nov 30, 2017
OSX Installation
View README.md

Installation:

Home brew packages:

$ brew install \
  coreutils \
View pourquoi *pn ?
#include <stdio.h>
int main ()
{
int chiffres[3];
char *pn = 0;
x = 0;
pn = chiffres;
View gist:0e3a2b6420f2ea23c33ad03d9d6e09b3
#include <stdio.h>
void ft_is_negative(int n)
{
if (n < 0)
{
putchar('N');
}
else
{
View gist:9bdb91b255da4acd0d7d
#!/bin/bash
#
# lxc: linux Container library
# Authors:
# Daniel Lezcano <daniel.lezcano@free.fr>
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
View fabric switch_user content manager
from contextlib import nested
from fabric.api import task, run, settings, env
def switch_user(user):
return nested(settings(
user=user,
host_string="%s@%s:%s" % (user, env['host'], env['port'])
))
@task
@harobed
harobed / gist:5845674
Created Jun 23, 2013
python assert equal with ellipsis
View gist:5845674
import unittest
import re
class BaseTest(unittest.TestCase):
def assertEqualEllipsis(self, first, second, ellipsis_marker='...', msg=None):
"""
Example :
>>> self.assertEqualEllipsis('foo123bar', 'foo...bar')
You can’t perform that action at this time.