Skip to content

Instantly share code, notes, and snippets.

#include <stdlib.h>
#include <iostream>
class A {
public:
A() {
std::cout << "A ctor" << std::endl;
}
~A() {
[alias]
amend-message = "!bash -c ' \
c=$0; \
if [ $c == \"bash\" ]; then echo \"Usage: git amend-message <commit>\"; exit 1; fi; \
saved_head=$(git rev-parse HEAD); \
commit=$(git rev-parse $c); \
commits=$(git log --reverse --pretty=format:%H $commit..HEAD); \
echo \"Rewinding to $commit...\"; \
git reset --hard $commit; \
git commit --amend; \
#!/usr/bin/ruby
module Kernel
def method_missing(sym, *args, &block)
s = sym.to_s
if s.length > 2 && s[0,2] == 'jt'
real_name = s[2..-1]
send(real_name.to_sym, *args, &block)
end
end
#include <iostream>
using namespace std;
class A {
public:
A(int val) : m_val(val) {}