Skip to content

Instantly share code, notes, and snippets.

View vic's full-sized avatar
🤮
puke nuke

Victor Borja vic

🤮
puke nuke
View GitHub Profile
@vic
vic / twitter.js
Created June 18, 2013 13:59
Extracting vine's video url from tweets, from www.antojame.com code.
var $ = require('jquery')
var _ = require('underscore')
var Twitter = require('twitter-api');
var twitter_consumer = {
'consumer_key' : 'XXX',
'consumer_secret' : 'XXX'
}
var twitter_token = {
'access_token_key' : 'XXX',
%title {{title}}
@vic
vic / elasticsearch_spanish_analyzer.yml
Created December 14, 2012 18:48
Copy and paste this fragment at the end of your elasticsearch.yml file. If you're on mac, and installed elasticsearch using brew, this configuration should be at /usr/local/Cellar/elasticsearch/0.19.10/config/elasticsearch.yml
index:
analysis:
analyzer:
spa:
type: custom
tokenizer: standard
filter: [standard, asciifolding, lowercase, stop, snow_spa]
default:
type: custom
tokenizer: standard

.

@vic
vic / fancy.rb
Created August 1, 2011 08:04
Parsing the Fancy Language with KPeg.
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift File.expand_path('../../kpeg/lib', __FILE__)
require 'kpeg'
class Fancy
G = KPeg::Grammar.new
KPeg.compile DATA.read, "Parser", self
-------------------------------------------------------------------------------
Test set: com.jwm.sct.portal.interno.view.carreteras.FiltrosControllerIT
-------------------------------------------------------------------------------
Tests run: 9, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 1.396 sec <<< FAILURE!
listTramosJson(com.jwm.sct.portal.interno.view.carreteras.FiltrosControllerIT) Time elapsed: 0.154 sec <<< ERROR!
org.codehaus.jackson.map.JsonMappingException: failed to lazily initialize a collection of role: com.jwm.sct.portal.interno.domain.carreteras.Carretera.fichas, no session or session was closed (through reference chain: com.jwm.sct.portal.interno.domain.search.SearchResult["results"]->java.util.ArrayList[0]->com.jwm.sct.portal.interno.domain.carreteras.Tramo["carretera"]->com.jwm.sct.portal.interno.domain.carreteras.Carretera["fichas"])
at org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:218)
at org.codehaus.jackson.map.JsonMappingException.wrap
@vic
vic / autotest.rb
Created February 13, 2011 23:26
Creating an Apache Buildr addon for incremental testing (using guard gem)
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
// asi se mandaria llamar un filtro para carreteras
// que filtre por estado.id,
$.ajax({
url: "/filtros/carreteras", // Esta action estaria en el FiltrosController
type: 'POST',
dataType: 'json',
contentType: 'application/json',
data: JSON.stringify({
filters: [
{ 'estado.id': '77' },
diff --git a/Client/GithubAPIController.j b/Client/GithubAPIController.j
index 1317fa5..3f55087 100644
--- a/Client/GithubAPIController.j
+++ b/Client/GithubAPIController.j
@@ -630,7 +630,7 @@ because one day maybe GitHub will give this to me... :)
else
{
var auth = [self isAuthenticated],
- text = (auth) ? "Make sure your account has sufficiant privalies to modify an issue or reposotory. " : "The action you tried to perfom requires you to be authenticated. Please login.";
+ text = (auth) ? "Make sure your account has sufficient privileges to modify an issue or repository. " : "The action you tried to perfom requires you to be authenticated. Please login.";
gcc -Ivm/external_libs/llvm/include -I/more/vic/hk/rubinius/vm/external_libs/llvm/Release/include -DNDEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -fomit-frame-pointer -fPIC -Ivm/external_libs/libtommath -Ivm/external_libs/libgdtoa -Ivm/external_libs/onig -Ivm/external_libs/libffi/include -Ivm/test/cxxtest -Ivm -I. -I/usr/local/include -Ivm/external_libs/udis86 -pipe -Wall -fno-omit-frame-pointer -DENABLE_LLVM -DHAS_EXECINFO -DHAS_READLINE -ggdb3 -O2 -Werror -DRBX_PROFILER -c -o vm/builtin/io.o vm/builtin/io.cpp 2>&1
cc1plus: warnings being treated as errors
vm/builtin/io.cpp: In member function ‘rubinius::Object* rubinius::IO::send_io(rubinius::VM*, rubinius::IO*)’:
vm/builtin/io.cpp:1050: error: dereferencing type-punned pointer will break strict-aliasing rules
vm/builtin/io.cpp: In member function ‘rubinius::Object* rubinius::IO::recv_fd(rubinius::VM*, rubinius::CallFrame*)’:
vm/builtin/io.cpp:1090: error: dereferencing type-punned pointer will break strict-aliasing rules
vm/builtin/io