Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Millennials just wanna have 🥑s

Lucas lfzawacki

💭
Millennials just wanna have 🥑s
View GitHub Profile
@lfzawacki
lfzawacki / changedb
Created May 14, 2014
Simple script to manage different database.yml files in a rails development environment
View changedb
#!/home/lucas/.rbenv/shims/ruby
# Use an appropriate file path for your ruby interpreter
require 'fileutils'
class ChangeDB
def initialize dir='config/.changedb', db_yml='config/database.yml'
@dir = dir
@db_yml = db_yml
@lfzawacki
lfzawacki / bbb-whiteboard.css
Created Jul 21, 2014
BBB whiteboard meteor
View bbb-whiteboard.css
/* CSS declarations go here */
svg {
border: 1px solid #000;
}
#messages {
margin-left: 400px;
}
View convertmp3.sh
#!/bin/bash
# Convert lots of *.flac into *.mp3 for consumption in devices without flac support
# Usage is:
# $ cd yourflacfolder
# $ convertmp3
# Files will be created in a new directory
MP3DIR="`basename \"$PWD\"` - mp3"
@lfzawacki
lfzawacki / user.rb
Created Mar 3, 2015
Users logged last month
View user.rb
class User < ActiveRecord::Base
def self.login_last_month
self.select { |u| u.last_sign_in_at && (u.last_sign_in_at + 30.days) >= Date.today }.count
end
end
@lfzawacki
lfzawacki / alarm.ino
Last active Aug 29, 2015
Introdução a Programação com Arduino (28/03/15)
View alarm.ino
/*
Por Lucas Zawacki e galera da oficina de introdução a Arduino
https://matehackers.org/arduino_day_2015
*/
const int buttonPin = 2;
const int buzzerPin = 11;
const int sensorPin = 4;
const int ledPin = 13;
@lfzawacki
lfzawacki / install-owncloud.sh
Last active Aug 29, 2015
install-owncloud.sh
View install-owncloud.sh
#!/bin/bash -e
FILENAME=owncloud-8.0.4.tar.bz2
LATEST=https://download.owncloud.org/community/$FILENAME
SHA=https://download.owncloud.org/community/$FILENAME.sha256
PGP=https://download.owncloud.org/community/$FILENAME.asc
INSTALL_PATH=/var/www
OWNCLOUD_USER='www-data'
echo " --- Download and check sha256 sum"
@lfzawacki
lfzawacki / README.md
Created Aug 7, 2015
Using local Gemfiles
View README.md

Using local Gemfiles

This is useful if you're working on a project with other developers and want to use different gems locally that you don't have to commit to the repository.

Get the Gemfile.local file

From this repository https://github.com/gerrywastaken/Gemfile.local. The rest the instructions here are mostly based on what is written there with some modifications.

View OOP with closures
#!/usr/bin/lua
do
POINT = {}
POINT.new = function(pnt, x, y)
local pt = {}
function pt.display(pnt, comment)
print(comment)
print(x)
@lfzawacki
lfzawacki / pandoc_example
Created Jan 5, 2011
Example of usage of pandoc to generate a book like document
View pandoc_example
% A Lua Book
% Many Great guys
yadaydayda
# Installing Lua
Pretty easy
# Rocketing to the Moon
View gist:1035519
From 14134e4fad0d549b8cdda34d411174c084076dc5 Mon Sep 17 00:00:00 2001
From: Lucas Fialho Zawacki <lfzawacki@gmail.com>
Date: Wed, 8 Jun 2011 23:49:34 -0300
Subject: dinput: EnumDevicesBySemantics enumerating system keyboard and mouse
---
dlls/dinput/dinput_main.c | 98 +++++++++++++++++++++++++++++++++++++++++---
1 files changed, 91 insertions(+), 7 deletions(-)
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c