Skip to content

Instantly share code, notes, and snippets.

View relaxdiego's full-sized avatar
🤓

Mark Maglana relaxdiego

🤓
  • The Linux Foundation
  • Earth, Solar System, Milky Way, Laniakea
View GitHub Profile
@relaxdiego
relaxdiego / lexer.rdsl
Last active December 23, 2015 00:59
Initial implementation of self-testing ManaMana (Do doo be-do-do!). I think it's cool that I can do this now. On the other hand, the .tdsl file below feels like an extra/unnecessary step. Clearly, ManaMana, is not well suited as a unit-testing tool which is fine because, when I wrote the gem, I imagined its use as an acceptance tool for a web ap…
RDSL Lexer
==========
* It tokenizes
```
This is a group name
====================
```
into
```
[1] guard(main)> Run options: --seed 2796
# Running tests:
.
Finished tests in 0.001458s, 685.8711 tests/s, 685.8711 assertions/s.
1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
RB.Object = {
// Douglas Crockford's technique for object extension
// http://javascript.crockford.com/prototypal.html
create: function(){
function F(){}
F.prototype = arguments[0];
var obj = new F();
// Add all the other arguments as mixins that
// 'write over' any existing methods
@relaxdiego
relaxdiego / graphite.md
Last active January 5, 2022 09:07 — forked from surjikal/graphite.md
Installing Graphite in OS X Mavericks

Follow these steps to install graphite on OS X Mavericks.

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Install dependencies

Install Cairo and friends

# git completion
source /usr/local/etc/bash_completion.d/git-completion.bash
source /usr/local/etc/bash_completion.d/git-prompt.sh
# unstaged (*) and staged (+) changes
# export GIT_PS1_SHOWDIRTYSTATE=1
# If something is stashed, then a '$' will be shown next to the branch name
# export GIT_PS1_SHOWSTASHSTATE=1
class TestSuite:
@patch('real_class_name')
def test_case(self, mock_class):
# Delay the evaluation of Mock() so that we get
# a new mock object for each time the (mocked)
# class constructor is called.
def new_mock_obj(*args, **kwargs):
mock_obj = Mock()
mock_obj.some_function.return_value = 'w00t'
demo:
provider: openstack
auth_service:
name: identity
host_uri: http://192.168.42.11:5000
request: create_token
validator: list_tenants
api_version: v3
@relaxdiego
relaxdiego / gist:be7b87cae8c2d51d5ee4
Last active June 12, 2020 09:44 — forked from dayyan/gist:e62bddc65ce1af735f0f
Setting up git send-email in OS X
  1. Configure Gmail in you gitconfig:
[sendemail]
  smtpserver = smtp.gmail.com
  smtpserverport = 587
  smtpencryption = tls
  smtpuser = <gmail email address>
  from = <email address for From: field>

Gateway IP (192.168.10.1) is NOT specified

Host 1

root@host1:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
10.0.2.0        *               255.255.255.0   U     0      0        0 eth0
kind: List
apiVersion: v1beta3
items:
- kind: ReplicationController
apiVersion: v1beta3