Skip to content

Instantly share code, notes, and snippets.

View ukabu's full-sized avatar

Ukabu ukabu

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ukabu on github.
  • I am ukabu (https://keybase.io/ukabu) on keybase.
  • I have a public key ASDqMljs1-zLSudCxPk2Uu7cPA2LEqUn6J-rXkGN1k7j-Ao

To claim this, I am signing this object:

index b70f4ad..4dddb4a 100644
--- a/package.js
+++ b/package.js
@@ -29,22 +29,18 @@ Package.onUse(function(api) {
api.use("meteorhacks:inject-initial@1.0.2", "server");
api.addFiles([
+ // On the client, we use un-minified React, Meteor will minimize when building for prod.
"vendor/react-with-addons-" + reactVersion + ".js",
- "vendor/react-with-addons-" + reactVersion + ".min.js"
@ukabu
ukabu / gulpfile.js
Created February 20, 2014 14:08
Graphviz dot to png using Gulp
var gulp = require('gulp')
var spawn = require('gulp-spawn')
gulp.task('dot', function() {
return gulp.src('*.dot')
.pipe(spawn({
cmd: 'dot'
, args: ['-Tpng']
, filename: function(base, ext) {
return base+'.png'
# Quick hack to be able to reboot a Vagrant Windows VM during provisioning.
#
# This files goes in the same folder as your vagrant file.
#
# Then you (in your Vagrantfile):
# require_plugin './windows_reboot_plugin'
#
# Your provisioners run in order, so...
# config.vm.provision :shell, :inline => "stuff that need a reboot"
# config.vm.provision :reboot
@ukabu
ukabu / act_as_searchable.md
Last active December 15, 2015 20:29
Using lots of custom fields in Redmine? On a MySQL database? Tired waiting for your searches to complete? Here's a quick fix.

Here is my modified act_as_searchable.rb (we are still using Redmine 1.4.x but the fix can easily be applied to Redmine 2.x).

Our MySQL version is 5.5.

Using LOWER in LIKE queries is just a waste of time, unless you changed the coalescence of the searched columns, the comparison will be case insensitive. So these should be removed. (Lines 88 and 97).

The main culprit though is the IN subquery for the custom_values table. The WHERE clause also match the customized_id with the parent query id. This is not necessary when using IN. So we removed it from the WHERE clause. However MySQL makes it a DEPENDENT SUBQUERY and will not cache the results. This means that the query will be repeated for every issue. A quick hack is to wrap the subquery in another subquery to make it part of a FROM clause. This, MySQL will create a temporary table for the subquery and reuse it for every issues. (line 97)

Our database contains almost 3000 issues and more than 50000 rows in the custom_values tables. These fixes made a s

@ukabu
ukabu / Rakefile
Created November 30, 2010 16:24
Rakefile to replace Phonegap Makefile (webOS)
require 'rake/clean'
PHONEGAP_SRC = FileList['js/phonegap.js.base', 'js/*.js']
PHONEGAP_JS = 'framework/www/phonegap.js'
SCENE = 'framework/www/app/views/First/First-scene.html'
APP_ID = 'com.palm.yourappid'
IPK = APP_ID + '_1.0.0_all.ipk'
file PHONEGAP_JS => PHONEGAP_SRC do |t|
open(PHONEGAP_JS, 'w') do |f|