Skip to content

Instantly share code, notes, and snippets.

View alcidesjunior's full-sized avatar
💻
Codando...

Alcides Junior alcidesjunior

💻
Codando...
View GitHub Profile
@alcidesjunior
alcidesjunior / gist:ca82717e4b40c4c17df7
Created November 23, 2015 13:44
Problema com estrutura
Order.where(:created_at=>dt1.beginning_of_day..dt2.end_of_day).each{|p1|
dt << p1.created_at.strftime("%d/%m/%Y")
Orderitem.where(orders_id: p1.id).each {|p2|
quantity << {data: p1.created_at.strftime("%d/%m/%Y"), product: Product.find_by_id(p2.products_id).product_name,quantity: p2.quantity}
}
}
from bottle import auth_basic,run, request, response,HTTPResponse,Bottle
import json,md5,time
from dbase import database as db
app = Bottle()
@app.hook('before_request')
def enable_cors():
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = 'PUT, GET, POST, DELETE, OPTIONS'
$http({
url:"http://127.0.0.1:3000/login",
contentType:"application/json",
method:"POST",
data: JSON.stringify(login) ,
}).success(function(e){
console.log(e);
});
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.2'
@alcidesjunior
alcidesjunior / 1 Gist conventions
Created April 24, 2017 14:11 — forked from PavloBezpalov/1 Gist conventions
Deploy Rails 5.0.0.beta3 to VPS(Ubuntu 14.04.4 LTS). Nginx, Puma, Capistrano3, PostgreSQL, RVM.
<<APP>> change this variables
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { LoginPage} from '../login-page/login-page';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController) {
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { LoginPage} from '../login-page/login-page';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController) {
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { ToastController } from 'ionic-angular';
import { HomePage } from '../home/home';
/**
* Generated class for the LoginPage page.
*
* See http://ionicframework.com/docs/components/#navigation for more info
* on Ionic pages and navigation.
*/
{
"place": [
{
"id": 1,
"nome_espaco": "Salao de festas",
"descricao": "Salao usado para festas",
"max_pessoa": 20,
"intervalo_min_reserva": 5,
"valor": 400.35,
"regras_gerais": "Não pode remover as lampadas do espaco",
@alcidesjunior
alcidesjunior / CoroaCircular.java
Last active July 11, 2017 00:44
codigo da coroa circular
public class Main {
public static void main(String[] args){
CoroaCircular cc = new CoroaCircular(10,8);
System.out.println(cc.calAreaCC());
}
}
public class AreaCirculo{
public double calcArea(double raio){
return Math.pow(raio,2)*(Math.PI);