Skip to content

Instantly share code, notes, and snippets.

View marti1125's full-sized avatar
๐Ÿ

Willy Aguirre marti1125

๐Ÿ
View GitHub Profile
@marti1125
marti1125 / gist:5049441
Last active December 14, 2015 07:19
blank.html crud
<div div class="wizard" id="wizard-crud">
<h1>Agregar Aplicaciรณn</h1>
<div class="wizard-card" data-cardname="aplicacion">
<h3 class="noshowtitle">Aplicacion</h3>
#{form action:@create(), enctype:'multipart/form-data', class:'form-horizontal', id:'crear'}
<div class="formWizard">
#{crud.form /}
</div>
#{/form}
</div>
package spark;
import spark.*;
public class Spark {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
@marti1125
marti1125 / gist:5083055
Created March 4, 2013 15:34
crud search
#{form action:@list().remove('page'), method:'GET', class:'form-search'}
<input placeholder="Nombres Completos" class="input-medium search-query span8" type="text" id="search" name="search" />&nbsp;&nbsp;&nbsp;
<input placeholder="Cรณdigo" class="input-medium search-query span2" type="text" id="search" name="search" />&nbsp;&nbsp;&nbsp;
<input type="submit" class="btn btn-primary span2 right" value="Buscar">
#{/form}
@marti1125
marti1125 / gist:5093722
Created March 5, 2013 19:59
sql concat
select nomter, apepatter ,apematter from app_segintersys.adm_identificacionweb where concat(nomter,' ',apepatter,' ',apematter) like '%Luis Coronel Aliaga%'
@marti1125
marti1125 / gist:5101006
Created March 6, 2013 17:09
seach selected
#{if ""+sede.codigoSede == codigoSede } selected #{/if}
@marti1125
marti1125 / gist:5119841
Created March 8, 2013 21:05
method list
public static void list(int page, String code, String orderBy, String order) {
ObjectType type = ObjectType.get(getControllerClass());
notFoundIfNull(type);
if (page < 1) {
page = 1;
}
List<Model> objects;
Long count;
Long totalCount;
@marti1125
marti1125 / gist:5198938
Last active December 15, 2015 04:08
resolviendo dependencias antigua... en ruby on rails.
cuando te dan un proyecto antiguo...
https://github.com/egutter/agiles_call4papers/blob/master/Gemfile
encontre la version de sqllite3
http://rubyforge.org/frs/?group_id=254&release_id=44105
libsqlite3 en ubuntu
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
user = User.find_or_create_by_email(ENV['TEST_USER_EMAIL'].dup)
user.password = ENV['TEST_USER_PASSWORD'].dup
@marti1125
marti1125 / gist:5389032
Created April 15, 2013 15:39
can't dup NilClass
~/writermortis(master) $sudo bundle exec rake db:seed
rake aborted!
can't dup NilClass
/home/willy/writermortis/db/seeds.rb:9:in `dup'
/home/willy/writermortis/db/seeds.rb:9:in `<top (required)>'
/var/lib/gems/1.9.1/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:245:in `load'
/var/lib/gems/1.9.1/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:245:in `block in load'
/var/lib/gems/1.9.1/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:236:in `load_dependency'
/var/lib/gems/1.9.1/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:245:in `load'
/var/lib/gems/1.9.1/gems/railties-3.2.7/lib/rails/engine.rb:520:in `load_seed'
@marti1125
marti1125 / gist:5389107
Created April 15, 2013 15:51
set variable
~/writermortis(master) [email protected] TEST_USER_PASSWORD=123456 TEST_USER_NAME=marti1125 rake db:seed
rake aborted!
can't dup NilClass
/home/willy/writermortis/db/seeds.rb:9:in `dup'
/home/willy/writermortis/db/seeds.rb:9:in `<top (required)>'
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:245:in `load'
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:245:in `block in load'
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:245:in `load'
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/railties-3.2.7/lib/rails/engine.rb:520:in `load_seed'