Skip to content

Instantly share code, notes, and snippets.

View mente's full-sized avatar

Alex Vasilenko mente

View GitHub Profile
android {
defaultConfig {
versionName "actionbar"
}
signingConfigs {
release {
storeFile file("android.keystore")
...
}
}
@mente
mente / composerw
Last active December 20, 2015 10:39
Composer wrapper script that checks whether composer is installed in the system. If not - install it to bin folder of this script. Idea is taken from gradle and gradlew that I've been struggling with during this weekend.
#!/bin/bash
# Composer wrapper script that checks whether composer is installed in the system. If not - install it to bin folder of this script
# Idea is taken from gradle and gradlew that I've been struggling with during this weekend
# author - Alex Vasilenko http://github.com/mente
# Exit on any failure
set -e
#http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Name: logstash
Version: 1.1.12
Release: 1%{?dist}
Summary: logstash is a tool for managing events and logs
Group: System/Logging
License: ASL 2.0
URL: http://logstash.net/
Source0: http://semicomplete.com/files/logstash/logstash-%{version}-monolithic.jar
Source1: logstash
@mente
mente / gist:3205999
Created July 30, 2012 10:12
graylog analytics exception
Started POST "/analytics/shell" for 192.168.1.101 at Mon Jul 30 06:10:37 -0400 2012
Processing by AnalyticsController#shell as */*
Parameters: {"cmd"=>"stream('50155c10bb705c5375000007').count()"}
Error while computing shell command: illegal ObjectId format/usr/lib64/ruby/gems/1.8/gems/bson-1.3.1/lib/../lib/bson/types/object_id.rb:129:in `from_string'
/usr/lib64/ruby/gems/1.8/gems/bson-1.3.1/lib/../lib/bson/types/object_id.rb:26:in `ObjectId'
/opt/graylog2-web-interface/app/models/stream.rb:39:in `find_by_id'
/opt/graylog2-web-interface/app/models/shell.rb:84:in `parse_stream_narrows'
/opt/graylog2-web-interface/app/models/shell.rb:78:in `each'
/opt/graylog2-web-interface/app/models/shell.rb:78:in `parse_stream_narrows'
/opt/graylog2-web-interface/app/models/shell.rb:57:in `parse'
Started GET "/streams/50155c10bb705c5375000007-web-errors/messages" for 192.168.1.101 at Mon Jul 30 06:06:06 -0400 2012
Processing by MessagesController#index as HTML
Parameters: {"stream_id"=>"50155c10bb705c5375000007-web-errors"}
Completed 500 Internal Server Error in 41ms
ArgumentError (symbol string may not contain `\0'):
tire (0.3.12) lib/tire/results/item.rb:18:in `to_sym'
tire (0.3.12) lib/tire/results/item.rb:18:in `initialize'
tire (0.3.12) lib/tire/results/item.rb:14:in `each_pair'
tire (0.3.12) lib/tire/results/item.rb:14:in `initialize'
@mente
mente / gist:2585300
Created May 3, 2012 12:22
Elasticsearch nested type update
Works:
{
"script": "ctx._source.comments = comments",
"params": {
"comments": [{
"id": 123,
"body": "boom"
}]
}
}
diff --git a/cloud-carousel.1.0.5.js b/cloud-carousel.1.0.5.js
index b6fc6a9..2e7bdf6 100644
--- a/cloud-carousel.1.0.5.js
+++ b/cloud-carousel.1.0.5.js
@@ -147,19 +147,22 @@
clearTimeout(event.data.showFrontTextTimer);
$(options.altBox).html( ($(event.target).attr('alt') ));
$(options.titleBox).html( ($(event.target).attr('title') ));
- if ( options.bringToFront && event.type == 'click' )
- {
--- a/server/modules/http-plugin/web/js/cloud-carousel.1.0.5.js
+++ b/server/modules/http-plugin/web/js/cloud-carousel.1.0.5.js
@@ -209,6 +207,9 @@
this.rotate = function(direction)
{
this.frontIndex -= direction;
+ if (this.frontIndex < 0) {
+ this.frontIndex = items.length - 1;
+ }
this.frontIndex %= items.length;
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean" securityManager-ref="webSecurityManager" loginUrl="/login" successUrl="/accounts/profile">
<property name="filterChainDefinitionMap">
<map>
<entry key="/accounts/**" value="passThru"/>
<entry key="/login" value="passThru"/>
<entry key="/admin/**" value="passThru, roles[ADMIN]"/>
</map>
</property>
</bean>
@mente
mente / content.json
Created November 29, 2011 10:49
query_all with hyphens
{
...
"address": "9 Rue Saint - Hubert, Laval, QC H7G 2X7, Canada"
...
}