Skip to content

Instantly share code, notes, and snippets.

View dannluciano's full-sized avatar
🏠
Working from home

Dann Luciano dannluciano

🏠
Working from home
View GitHub Profile
@dannluciano
dannluciano / threads.c
Created October 22, 2011 02:57
A simple example for using thread in c/c++.
// usage:
// gcc -o thread threads.c
// ./thread time
// time is the number of seconds
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
@dannluciano
dannluciano / thread_example.c
Created November 8, 2011 11:28
The simple example of Threads in C
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <stdbool.h>
void* sleep_func(void* argument)
{
int time = 10;
sleep(time);
@dannluciano
dannluciano / .zshrc
Created February 24, 2012 22:11
.zshrc
# DESCRIPTION:
# A simple zsh configuration that gives you 90% of the useful features that I use everyday.
#
# AUTHOR:
# Geoffrey Grosenbach http://peepcode.com
# Colors
autoload -U colors
colors
setopt prompt_subst
@dannluciano
dannluciano / application.rb
Created April 30, 2012 10:59
My personal style of organizing sinatra apps
# application.rb
class Application < Sinatra::Base
set :root, File.dirname(__FILE__)
end
@dannluciano
dannluciano / calendar.lotr
Created May 19, 2012 19:43
calendar.lotr
cat usr/share/calendar/calendar.lotr
/*
* Lord Of The Rings
*
* $FreeBSD: src/usr.bin/calendar/calendars/calendar.lotr,v 1.2 2003/10/09 00:31:48 grog Exp $
*/
#ifndef _calendar_lotr_
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char *argv[])
{
printf ("Hello World!\n");
return EXIT_SUCCESS;
}
@dannluciano
dannluciano / main.tex
Created August 7, 2012 14:33
main.tex
% !TEX encoding = UTF-8 Unicode
\documentclass{abnt}
\usepackage{graphicx,url}
\usepackage[brazil]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tabela-simbolos}
\usepackage{pgffor}
\usepackage[chapter]{algorithm}
@dannluciano
dannluciano / random.cpp
Created December 14, 2012 21:45
Random number in new c++11
// To compile use this:
// make random CPPFLAGS=-std=gnu++11
#include <iostream>
#include <random>
int main(int argc, char *argv[]) {
std::random_device rd;
int seed = rd();
std::mt19937 g1 (seed);
std::mt19937_64 g2 (seed);
// g++ -std=c++11 random.cpp -o random
#include <iostream>
#include <random>
int main ()
{
std::random_device rd;
std::cout << "default random_device characteristics:" << std::endl;
std::cout << "minimum: " << rd.min() << std::endl;
@dannluciano
dannluciano / spec.log
Created March 1, 2013 20:47
rake spec in dm-core
This file has been truncated, but you can view the full file.
The source :rubygems is deprecated because HTTP requests are insecure.
Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************