Skip to content

Instantly share code, notes, and snippets.

View lucasmarqs's full-sized avatar

Lucas Marques lucasmarqs

  • Sao Paulo, Brazil
View GitHub Profile
@lucasmarqs
lucasmarqs / movies.go
Last active December 19, 2018 11:54
API IMDB
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
"sort"
"strconv"
"strings"
@lucasmarqs
lucasmarqs / server.rb
Created May 4, 2018 16:51
Ruby web server from std lib
require 'webrick'
require 'json'
server = WEBrick::HTTPServer.new Port: 9000
server.mount_proc '/' do |request, response|
response.body = 'Hello World from WEBrick'
end
server.mount_proc '/ping' do |request, response|
response.body = JSON.generate({pong: true})
@lucasmarqs
lucasmarqs / tmux.conf
Created April 13, 2018 18:27
tmux.conf
#-------------------------------------------------------------------------------
# POWER ALL THE LINE!
# run-shell "powerline-daemon -q"
# source "$HOME/workspace/powerline/powerline/bindings/tmux/powerline.conf"
# edit configuration
bind e new-window -n '~/.tmux.conf' "sh -c '\${EDITOR} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'"
#-------------------------------------------------------------------------------
# List of plugins
@lucasmarqs
lucasmarqs / tmux.conf
Created April 13, 2018 18:27
tmux.conf
#-------------------------------------------------------------------------------
# POWER ALL THE LINE!
# run-shell "powerline-daemon -q"
# source "$HOME/workspace/powerline/powerline/bindings/tmux/powerline.conf"
# edit configuration
bind e new-window -n '~/.tmux.conf' "sh -c '\${EDITOR} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'"
#-------------------------------------------------------------------------------
# List of plugins
@lucasmarqs
lucasmarqs / .gitconfig
Last active December 1, 2020 22:05
My options for ~/.gitconfig
[user]
name = My name
email = my_github_email@example.com
[alias]
a = add
ap = add -p
can = commit -S --amend --no-edit
cm = commit -S -m
co = checkout
@lucasmarqs
lucasmarqs / fib_hash.rb
Created April 1, 2017 22:58
Recursive Fibonacci with Ruby Hash
fib = Hash.new do |hash, key|
if key < 2
hash[key] = key
else
hash[key] = hash[key-2] + hash[key-1]
end
end
#=> {}
fib[3]
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void bubbleSort(int vet[], int len);
int main() {
srand(time(NULL));
int vet[10];
@lucasmarqs
lucasmarqs / Preferences.sublime-settings
Last active May 10, 2017 12:55
Sublime preferences
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
@lucasmarqs
lucasmarqs / tools_controller.rb
Last active May 23, 2016 00:54
Minimum CRUD on Rails
class Admin::ToolsController < AdminController
expose :tools, ancestor: :company
expose :tool, attributes: :tool_params
def create
if tool.save
set_flash_success_and_redirect_to admin_tools_path
else
render :new
end
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Node {
float value;
struct Node *next;
};
int isNumber(char input[]);