Skip to content

Instantly share code, notes, and snippets.

View squillace91's full-sized avatar
🚀
building cool things

João S squillace91

🚀
building cool things
  • BC, Canada
  • 02:19 (UTC -07:00)
View GitHub Profile
@squillace91
squillace91 / gist:2190806
Created March 25, 2012 02:23
Lab_AEDII_Lista04Exercicio01
/*
* File: L04E02 (Fibonacci)
* Author: squillace91
*
* Created on 23 de Março de 2012, 15:25
*/
#include <stdio.h>
#include <stdlib.h>
@squillace91
squillace91 / b_tree_atual.c
Last active December 15, 2015 08:09
B_tree funcionando tudo certinho, mas quando voce busca e depois insere, é inserido um lixo no final. ela está tratando a incializacao.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "stdio.h"
#include "sys/stat.h"
#include "fcntl.h"
#include "b_tree_atual.h"
// Ponteiro Global do Arquivo de Indice e Raiz, usado em todas as funções praticamente
FILE *btfd; /* global file descriptor for "btree.dat" */
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
</style>
</head>
@squillace91
squillace91 / packages using command line
Last active November 7, 2017 19:23
useful packages
# git extras add funtionalities to git, such as git ignore --- git ignore build "node_modules" ---
sudo apt-get install git-extras
#open touchegg config file
xdg-open ~/.config/touchegg/touchegg.conf
nvm ls --- show node version
rvm rubies --- show ruby version
@squillace91
squillace91 / jungle
Last active November 8, 2017 18:33
setting up jungle
cp config/database.example.yml config/database.yml
bin/rails s -b 0.0.0.0 --- run rails using the current project version
s is shorter for server
@squillace91
squillace91 / setup-rails
Last active November 9, 2017 01:20
Setting up a new project using rails --- blog example
#create a new model
bin/rails generate model Article title:string text:text
bin/rails generate model Comment commenter:string body:text article:references
- it creates a migration in db/migrate
#create a controller
bin/rails generate controller Comments
#run migration
bin/rake db:migrate
@squillace91
squillace91 / newlogin
Created November 9, 2017 21:08
login user jungle
<h1>Login</h1>
<%= form_tag '/sessions/' do %>
Email: <%= text_field_tag :email %>
Password: <%= password_field_tag :password %>
<%= submit_tag "Submit" %>
<% end %>
@squillace91
squillace91 / temp user login
Created November 9, 2017 21:19
temp user login
<section class="admin-products-new">
<header class="page-header">
<h1>Login</h1>
</header>
<div class="row">
<div class="col-sm-6 col-sm-offset-1">
<%= form_for :user, url: '/sessions' do |form| %>
@squillace91
squillace91 / deployment.heroku
Last active November 14, 2017 00:53
Steps to deploy jungle to heroku
#installing heroku
wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh
heroku login
----login
----pwd
heroku create
git config --list | grep heroku
git push heroku heroku-deployment:master