Skip to content

Instantly share code, notes, and snippets.

View nazgob's full-sized avatar
🎯
Focusing

Przemek Owczarek nazgob

🎯
Focusing
View GitHub Profile
@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@nazgob
nazgob / timer.rb
Created December 7, 2010 21:45
timer in ruby shoes
Shoes.app :height => 150, :width => 250 do
background rgb(240, 250, 208)
stack :margin => 10 do
button "Start" do
@time = Time.now
@label.replace "Stop watch started at #@time"
end
button "Stop" do
@label.replace "Stopped, ", strong("#{Time.now - @time}"), " seconds elapsed."
end
@nazgob
nazgob / Rakefile
Created November 14, 2010 00:30
simple/sample Rakefile for C++
# constants
COMPILER = "g++"
EXEC = "hello"
FLAGS = "-Wall -Wextra"
OBJECTS = ['hello.o', 'add.o']
file 'hello' => OBJECTS
# tasks
@nazgob
nazgob / ladder.md
Last active September 6, 2017 08:21 — forked from jamtur01/ladder.md
Chaos is a Ladder.
@nazgob
nazgob / atomic.c
Created June 3, 2010 17:31
atomic variables on gcc / linux
// http://www.alexonlinux.com/multithreaded-simple-data-type-access-and-atomic-variables
// gcc -lpthread -D_GNU_SOURCE -o atomic atomic.c
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
#include <sched.h>
#include <linux/unistd.h>
#include <sys/syscall.h>
@nazgob
nazgob / gist:2367583
Created April 12, 2012 14:13
vagrant cheatsheet
# setup vagrant
gem install vagrant
vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
mkdir my_vagrant_test
cd my_vagrant_test
vagrant init lucid32
vim Vagrantfile
vagrant up
vagrant ssh
@nazgob
nazgob / gist:7591862
Created November 21, 2013 23:31
c++ warning
/home/vagrant/gmock-1.6.0/include/gmock/gmock-generated-function-mockers.h: In member function ‘typename testing::internal::Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>::Result testing::MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)>::Call(typename testing::internal::Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>::Argument1, typename testing::internal::Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>::Argument2, typename testing::internal::Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>::Argument3, typename testing::internal::Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>::Argument4, typename testing::internal::Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>::Argument5, typename testing::internal::Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>::Argument6, typename testing::internal::Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>::Argument7, typename testing::internal::Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>::Argument8, typename testing::intern
@nazgob
nazgob / play_js.html
Created May 5, 2013 16:56
kickoff jasmine
<!DOCTYPE html>
</html>
<head>
<title>Jasmine</title>
</head>
<body>
<script type="text/javascript" src="http://searls.github.com/jasmine-all/jasmine-all-min.js"></script>
<script type="text/javascript">
window.hugPanda = function(){ return "yay!"; };
@nazgob
nazgob / rspec.rb
Created September 30, 2012 14:05
Sample rspec implementation from DestroyAllSoftware
require 'test/unit'
def describe(description, &block)
ExampleGroup.new(block).evaluate!
end
class ExampleGroup
def initialize(block)
@block = block
end
@nazgob
nazgob / gist:2404475
Created April 17, 2012 08:19
tropo stuff
Creating first Tropo app => https://www.tropo.com/docs/scripting/creating_first_application.htm
Tropo provisioning gem => https://github.com/tropo/tropo-provisioning
Pastebin with => http://pastebin.com/raw.php?i=dLCjebGy
Tropo docs related to session => https://www.tropo.com/docs/rest/starting_session_web_api.htm
Tropo sample docs => http://blog.tropo.com/2012/02/24/ruby-on-rails-conference-caller/
Gist with more samples => https://gist.github.com/c3d0f759ab22f9904f61