Skip to content

Instantly share code, notes, and snippets.

View colbert-toledo's full-sized avatar

Jose Colbert Toledo Velasco colbert-toledo

View GitHub Profile
@colbert-toledo
colbert-toledo / settings.json
Last active August 24, 2018 15:23
VSCode Settings
{
"editor.fontSize": 18,
"workbench.colorTheme": "City Lights",
"editor.fontFamily": "FiraFlott, Consolas, 'Courier New', monospace",
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
//following will be in italic (=FlottFlott)
@colbert-toledo
colbert-toledo / map.java
Created March 11, 2018 00:56 — forked from seadowg/map.java
HashMap built naively with TDD (and Tests)
// The following code is a series of test that were written in the order you'll read them. After
// each test was written it was run against the HashMap and the implementation was updated if it
// failed. The HashMap code is the final implementation that was built naively to pass each test.
// The Tests:
public class HashMapTest {
private HashMap map;
// Set up an empty map before each test
@colbert-toledo
colbert-toledo / anki_notes.txt
Created April 27, 2017 15:41
Ruby Anki Notes
# Semantic Versioning
# Given a version number MAJOR.MINOR.PATCH, increment the:
# MAJOR version when you {make backwards-incompatible changes}
# MINOR version when you {add functionality in a backwards-compatible manner}
# PATCH version when you make backwards-compatible bug fixes.
---------------------------------------------------------------------------------------
"Como se llama este operador en ruby?" ~>
- - - - - - - - - - - - - - - - - - - - -
pessimistic operator
---------------------------------------------------------------------------------------
@colbert-toledo
colbert-toledo / sortDirective.js
Created March 5, 2016 23:37
Angular table sort directive
var fessmodule = angular.module('myModule', []);
fessmodule.controller('ctrlRead', function ($scope, $filter) {
// init
$scope.sort = {
sortingOrder : 'id',
reverse : false
};
/************** Complex form *****************************************/
.row {
background-color: lightblue;
border: 1px solid red;
}
<div class="row">
<div class="col-md-8">
<div class="row">
<div class="col-md-3">
/*************Back button*********************************/
<g:link uri="${request.getHeader('referer')}">
<button type="button" class="btn btn-warning"><i class="ionicons ion-arrow-return-left"></i> </button>
</g:link>
/*Imprimir bonito en consola*/
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = gson.toJson(params);
println(prettyJson);
/**************en el datasource expresion de una tabla en ireports ********************************/
new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{checadas})
new net.sf.jasperreports.engine.JREmptyDataSource(1)
/**********************************************/
$.ajax({
type: 'POST',
url: url,
data: {name: 'colbert'},
success: function (data) {
console.log(data);
}
});
/**********************************************/
@colbert-toledo
colbert-toledo / postgresql_snippets.sql
Last active October 12, 2015 16:36
Borra el esquema y lo vuelve a crear para no tener que borrar la base de datos y volverla a crear, asegurarse de que se ejecute en la tabla correcta
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
COMMENT ON SCHEMA public IS 'standard public schema';
/*Borrar un constraint*/
alter table empleado drop constraint empleado_nombre_key// la clave 'empleado_nombre_key' es el identificador