Skip to content

Instantly share code, notes, and snippets.

View angelsystem's full-sized avatar

angel roberto angelsystem

View GitHub Profile
@angelsystem
angelsystem / spiner.swift
Created October 26, 2014 04:22
spinner swift IOs
//
// ViewController.swift
// spiner-alert
//
// Created by Angelito Rojas on 25/10/14.
// Copyright (c) 2014 Angelito Rojas. All rights reserved.
//
import UIKit
@angelsystem
angelsystem / alert.swift
Created October 26, 2014 04:17
Alert swift IOs
//
// ViewController.swift
// spiner-alert
//
// Created by Angelito Rojas on 25/10/14.
// Copyright (c) 2014 Angelito Rojas. All rights reserved.
//
import UIKit
@angelsystem
angelsystem / ViewController.swift
Last active August 29, 2015 14:08
use image galley or camera swift
//
// ViewController.swift
// instagram
//
// Created by Angelito Rojas on 25/10/14.
// Copyright (c) 2014 Angelito Rojas. All rights reserved.
//
import UIKit
@angelsystem
angelsystem / gist:11298664
Created April 25, 2014 18:22
log nested form
Block Load (0.5ms) SELECT "blocks".* FROM "blocks" WHERE "blocks"."project_id" = 33 ORDER BY name
Unit Load (5.8ms) SELECT "units".* FROM "units" WHERE "units"."project_id" = 33 ORDER BY id
PriceList Load (0.8ms) SELECT "price_lists".* FROM "price_lists" WHERE "price_lists"."project_id" = 33 AND (price_list_status = 'approved') ORDER BY created_at DESC LIMIT 1
UnitPrice Load (1.6ms) SELECT "unit_prices".* FROM "unit_prices" WHERE "unit_prices"."price_list_id" = 145
Rendered price_lists/new.html.haml within layouts/application (1417.6ms)
@angelsystem
angelsystem / ajax.html
Last active August 29, 2015 13:59
datatable filter no work
<!DOCTYPE html>
<html>
<!--
Created using jsbin.com
Source can be edited via http://jsbin.com/dusuhoju/3/edit
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Yet Another DataTables Column Filter (Yadcf) Showcase</title>
- show ||= 'cards'
- if show == 'list'
= div_for user, class: 'user-list' do
.user-description
.user-avatar
= avatar(user, class: "user-img")
.user-info
= link_to user.name, "", class: "name"
%p.role= user.role_name
#lib/startup_constraint.rb
class StartupConstraint
def matches?(request)
id = request.path.gsub("/", "")
Startup.find_by_slug(id)
end
end
#lib/user_constraint.rb
class UserConstraint
@angelsystem
angelsystem / gist:7932465
Last active December 31, 2015 04:09
delayed job hooks
class Newsletter < ActiveRecord::Base
def deliver
sleep 5 # simulate long newsletter delivery
update_attribute(:delivered_at, Time.zone.now)
end
handle_asynchronously :deliver
end
===============
= simple_form_for(@couple, url: save_family_clients_url, html: { multipart: true, id: 'form_modal_family', novalidate: true}, remote: true) do |f|
.head-modal
%p Asignacion de pareja
.body-modal.scroll-wrapp
= hidden_field_tag "parent", @parent.id
- if @parent.marital_status == 'M'
%fieldset
%legend Régimen de Propiedad
= f.input :married_regimen do
= f.select :married_regimen, [['Bienes Mancomunados', Client::REGIMENS[:community_property]], ['Bienes Separados', Client::REGIMENS[:separate_property]]]
# encoding : UTF-8
def credito(monto, tasa, nombre, ruc)
puts "El monto maximo sera de " + monto.to_s
puts "La tasa sera de " + tasa.to_s
puts nombre
puts ruc
end
puts "Ingrese la razón social"
nombre = gets.chomp