Skip to content

Instantly share code, notes, and snippets.

View kostajh's full-sized avatar

Kosta Harlan kostajh

View GitHub Profile
@kostajh
kostajh / taskwarrior-recognize.php
Created February 24, 2014 20:59
Ugly script to find malformed entries in taskwarrior data.
<?php
$dir = '/home/kosta/.task';
$files = array('pending.data', 'completed.data', 'undo.data', 'undo_remote.data');
foreach ($files as $file) {
$handle = fopen("/home/kosta/.task/" . $file, "r");
print 'Looking at file ' . $file . "\n";
$line_number = 0;
$ ~/.eclipse/org.eclipse.platform_793567567_linux_gtk_x86_64/eclimd
java -Xms128m -Xmx512m -Dorg.eclipse.swt.browser.UseWebKitGTK=true -Dhelp.lucene.tokenizer=standard -XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith -XX:CompileCommand=exclude,org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding,<init> -XX:CompileCommand=exclude,org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates,instantiateTemplate -XX:CompileCommand=exclude,org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage,addBinding -XX:CompileCommand=exclude,org/python/pydev/editor/codecompletion/revisited/PythonPathHelper,isValidSourceFile -XX:CompileCommand=exclude,org/eclipse/tycho/core/osgitools/EquinoxResolver,newState -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins -Declipse.p2.skipMovedInstallDetection=true -XX:MaxPermSize=256m -jar /usr/lib64/eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20131104-1241.jar -debug -clean -refresh -ap
@kostajh
kostajh / gist:9380365
Created March 6, 2014 01:21
Eclim install
$ java -jar eclim_2.3.2.jar
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd
Buildfile: installer.xml
2014-03-05 20:14:40,814 INFO [org.formic.Installer] Running Installer...
2014-03-05 20:15:24,190 INFO [org.formic.util.CommandExecutor] which gvim
2014-03-05 20:15:24,197 INFO [org.eclim.installer.step.VimStep] which gvim: /usr/bin/gvim
2014-03-05 20:15:24,198 INFO [org.formic.util.CommandExecutor] vim -f -X -u NONE -U NONE --cmd redir! > /tmp/eclim_installer389425476468186494.tmp | silent! echo &rtp | quit
2014-03-05 20:15:40,279 INFO [org.formic.util.CommandExecutor] vim --version
2014-03-05 20:15:41,839 INFO [org.formic.util.CommandExecutor] java -Xmx256m -XX:MaxPermSize=128m -jar /usr/lib64/eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20131104-1241.jar -clean -application org.eclipse.equinox.p2.director -repository file:///tmp/formic_939679033/update -installIU org.eclim.installer.feature.group
2014-03-05 20:15:51,501 INFO [org.formic.util.CommandExecutor] java -Xmx256m -XX:MaxPer
@kostajh
kostajh / gist:9390014
Created March 6, 2014 13:44
bugwarrior pull output
$ bugwarrior-pull
INFO:bugwarrior:Service-defined UDAs (add these to your ~/.taskrc):
INFO:bugwarrior:uda.githubnumber.label=Github Issue/PR #
INFO:bugwarrior:uda.githubnumber.type=numeric
INFO:bugwarrior:uda.githubtitle.label=Github Title
INFO:bugwarrior:uda.githubtitle.type=string
INFO:bugwarrior:uda.githubtype.label=Github Type
INFO:bugwarrior:uda.githubtype.type=string
INFO:bugwarrior:uda.githuburl.label=Github URL
INFO:bugwarrior:uda.githuburl.type=string
// Publication Authors
casper.test.begin('Verifying Publication Authors entity migration', function suite(test) {
// Load the JSON document.
var json = require(json_dir + '/' + datestamp + '/PUB_AUTHORS2.json');
var pubAuthorJoin = require(json_dir + '/' + datestamp + '/PUB_AUTHORS.json');
var currentRow = 0;
// Run the test.
casper.run(check);
@kostajh
kostajh / example_api.module
Created March 24, 2014 15:29
Example API for redirecting CasperJS to Drupal data.
<?php
/**
* Implements hook_menu().
*/
function example_api_menu() {
$items = array();
$items['api'] = array(
'page callback' => 'example_api_redirect',
'page arguments' => array(1, 2),
<?php
/**
* Read a CSV file.
*/
public function readCSV($file) {
$data = array();
if (file_exists($file)) {
$file_handle = fopen($file, 'r');
while (!feof($file_handle)) {
<?php
/**
* Write JSON encoded data to disk.
*/
protected function writeJson($filename, $data) {
if (!file_exists($this->getJsonDirectory())) {
if (!drush_mkdir($this->getJsonDirectory())) {
return drush_set_error('NO_JSON_DIR', dt('Unable to create JSON directory at !file', array('!file' => $this->getJsonDirectory())));
}
}

Keybase proof

I hereby claim:

  • I am kostajh on github.
  • I am kosta (https://keybase.io/kosta) on keybase.
  • I have a public key whose fingerprint is F809 9E36 EF23 7A0F 392A 469D 921B 04B1 FFEE D3F7

To claim this, I am signing this object:

@kostajh
kostajh / smart-features-revert.php
Created September 11, 2014 20:38
Use with Jenkins. Add this as a build step.
<?php
// This script analyzes the files affected between GIT_PREVIOUS_COMMIT and
// GIT_COMMIT. See https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin for
// more information on these parameters.
// If the files affected are in the /features directory, then we will call
// `drush features-revert {feature}` for each feature affected.
// Why is this necessary? Because `features-revert-all` will revert every
// feature on your site; we only want to revert features that are overridden.
/**