Skip to content

Instantly share code, notes, and snippets.

View foca's full-sized avatar

Nicolás Sanguinetti foca

View GitHub Profile
#include<iostream>
using namespace std;
struct Automobil{
int ser_broj;
char proizvodjac[50];
char model[50];
int godina;
};
@foca
foca / gist:49
Created July 21, 2008 02:46 — forked from bkerley/cacheslam.c
We couldn’t find that file to show.
Once upon a time a goat travelled happily through a green pasture
{ scopeName = 'source.ruby';
comment = '
TODO: unresolved issues
text:
"p << end
print me!
end"
symptoms:
not recognized as a heredoc
grammar Example
rule reminder
"tell me " time "to " anything:(.+)
end
rule time
("at" / "on") " " word+ &"to "
end
rule word
#!/bin/sh
export COLUMNS=$COLUMNS # term width isn't exported properly :(
export PS1='`ps1`'
@foca
foca / inspector.rb
Last active August 29, 2015 14:07
Find which tests always run before a given test when the suite fails, in order to detect ordering issues in your test suite.
#!/usr/bin/env ruby
#
# Find repeated output across runs of a process.
#
# Usage:
#
# ./inspector "./minitest-runner some_failing_test"
#
# The main purpose for this is to find tests that pollute the environment making
# other tests fail erratically, for test suites that run in a random order.
module M; end
class C; end
C.ancestors #=> [Object, Kernel]
C.send :include, M #=> C
C.ancestors #=> [M, Object, Kernel]
@foca
foca / screenify
Created February 7, 2015 21:16
A tool to load a `.tmuxify.layout` file and open a GNU Screen session with it. See https://github.com/tonchis/tmuxify
#!/usr/bin/env bash
set -e
[ -n "$DEBUG" ] && set -x
layout="$(pwd)/.tmuxify.layout"
if [ ! -f "$layout" ]; then
echo "Can't find ./.tmuxify.layout" >&2
exit 1
# this uses RspecHpricotMatchers: http://github.com/pd/rspec_hpricot_matchers
module FormFieldHpricotMatchers
# TODO: Add support for selects
# TODO: Test with anything that isn't an input[type=text] :P
class HaveField
include RspecHpricotMatchers
def initialize(id, type, tagname)
@tagname = tagname