Skip to content

Instantly share code, notes, and snippets.

@davidsf
davidsf / gist:1248059
Created September 28, 2011 14:19
Highchart pointer
@graph_column = LazyHighCharts::HighChart.new('column') do |f|
f.series(:name=>'Correct',:data=> [1, 2, 3, 4, 5])
f.series(:name=>'Incorrect',:data=> [10, 2, 3, 1, 4] )
f.title({ :text=>"clickable bar chart"})
f.legend({:align => 'right',
:x => -100,
:verticalAlign=>'top',
:y=>20,
:floating=>"true",
:backgroundColor=>'#FFFFFF',
@davidsf
davidsf / gist:2172358
Created March 23, 2012 16:17
link_to problem
= link_to ({:controller => params[:controller], :action => "seleccionados", :filter => current_param_filters} , :title => 'Ver un listado de los lotes seleccionados') do
/home/david/src/newpanel/app/views/application/_selections.haml:48: syntax error, unexpected ',', expecting ')'
...ter => current_param_filters} , :title => 'Ver un listado de...
@davidsf
davidsf / gist:3134646
Created July 18, 2012 06:43
Railo performance
Command: ab -n 10 url
Production Site - IIS 6.0 + Coldfusion 8.0
Requests per second: 3.98 [#/sec] (mean)
Time per request: 251.330 [ms] (mean)
Connection Times (ms)
min mean[+/-sd] median max
Connect: 44 52 11.4 48 79
<cfquery name="en_memoria" datasource="venvir">
SELECT * FROM Memoria WHERE Id_Lote = #datos_para_gateway.num_lote# AND URL_TOKEN = '#datos_para_gateway.usr_token#'
</cfquery>
<cfif #en_memoria.RecordCount# EQ 0>
<cfquery name="memoria" datasource="venvir">
INSERT INTO Memoria (Id_Lote, URL_Token, Fecha) VALUES (#datos_para_gateway.num_lote#, '#datos_para_gateway.usr_token#', #now()#);
</cfquery>
<cfelse>
<cfquery name="memoria" datasource="venvir">
UPDATE Memoria
@davidsf
davidsf / gist:5859062
Last active December 18, 2015 23:08
SqlServer Json River
{
"type":"jdbc",
"jdbc": {
"driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver",
"url":"jdbc:sqlserver://ipaddress:port;databaseName=mydatabase",
"user":"myuser","password":"mypass",
"sql":"select * from table",
"poll":"30s"
},
"index": {
12ms
13ms
12ms
11ms
11ms
10ms
20ms
11ms
12ms
12ms
// ORMSettings: flushatrequestend = false, automanagesession = false
// No errors, just obj.myprop not populate to db:
obj = cacheget(tag);
entityMerge(obj);
transaction {
obj.myprop = 'example';
}
"query": {
"bool": {
"should": [
{
"multi_match": {
"query": "malaga cromo",
"fields": [
"titulo"
],
"operator": "and"
"query": {
"filtered": {
"query": {
"bool": {
"must": [
{
"query_string": {
"default_field": "titulo",
"query": "malaga cromo",
"default_operator": "and"
@davidsf
davidsf / gist:5247895720da5754133b8a5b6279b94e
Created March 20, 2019 08:29
Name collision handlers vs model
handlers/product.cfc:
component{
function index( event, rc, prc ){
prc.product = EntityLoadByPk( 'product', 1);
dump(prc.product.user_id );
}
}