Skip to content

Instantly share code, notes, and snippets.

@ecerulm
ecerulm / Makefile
Last active December 10, 2015 21:48
Makefile template
CC = g++
# CFLAGS for the C compiler, CXXFLAGS for C++, and CPPFLAGS for both.
CXXFLAGS= -pedantic -Wall -Wextra -Werror -ggdb3
TARGET = my-executable
SOURCES = test.cpp
HEADERS = test.h
OBJECTS = $(SOURCES:.c=.o)
@ecerulm
ecerulm / Makefile
Created November 26, 2012 22:34
sample lua application
all: test
test: test.cpp
g++ test.cpp -llua -L$(HOME)/tmp/lua-5.2.1/src -I$(HOME)/tmp/lua-5.2.1/src -o test
@ecerulm
ecerulm / stat_runner.rb
Created February 27, 2012 22:43
custom testrunner
# Usage:
# ruby -rstat_runner [test] --runner=stat
# http://endofline.wordpress.com/2008/02/11/a-custom-testrunner-to-scratch-an-itch/require 'test/unit'
require 'test/unit/ui/console/testrunner'
class StatRunner < Test::Unit::UI::Console::TestRunner
def finished(elapsed_time)
nl
output("="*72)
output("|"+"Finished in #{elapsed_time} seconds.".center(70)+"|")
output("="*72)
@ecerulm
ecerulm / Ruby.sublime-build
Created January 29, 2012 08:37
Wrapper for spec (bundled) to use with Sublime Text 2
{
"cmd": ["/Users/ecerulm/bin/sublime_rvm.rb", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
<!-- Google search web element BEGIN-->
<div id="cse" style="width:100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1');
google.setOnLoadCallback(function(){
new google.search.CustomSearchControl('partner-pub-6449419902780618:ybxd02gp4hx').draw('cse');
}, true);
</script>
package org.eclipse.jface.dialogs;
/*******************************************************************************
* Copyright (c) 2000, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
<?php
error_reporting(E_ALL);
/* Make PEL speak the users language, if it is available. */
setlocale(LC_ALL, '');
require_once('pel/PelDataWindow.php');
require_once('pel/PelJpeg.php');
require_once('pel/PelTiff.php');
/*
* Adjust volume and eq setting of podcasts and audiobooks
* http://rubenlaguna.com/wp
* Jscript file must be run with Windows wscript.exe
* Based on a script by Otto - http://ottodestruct.com
*/
var iTunesApp = WScript.CreateObject("iTunes.Application");
var ITTrackKindFile = 1;
fso = new ActiveXObject("Scripting.FileSystemObject");
var folders = new Array();
function Initialize_enumFolders (path)
{
if (fso.driveExists(fso.GetDriveName(path)) && fso.folderExists(fso.GetDriveName(path)))
enumFolders(path);
}
function enumFolders(path)
{
@ecerulm
ecerulm / fix_disqus_urls.rb
Created August 16, 2010 22:46
fix urls and title in Disqus (after developer=1 misuse)
#!/usr/bin/env ruby
# After setting disqus_developer = 1 http://disqus.com/docs/embed/
# I got a lot of threads "corrupted".
# 1. Some of them had the wrong url, http://localhost:4000/xxxxxx.
# 2. Some of them had title == url.
# This script fixes both
# Replace http://localhost:4000 with http://rubenlaguna.com
# Disqus ruby api http://disqus.rubyforge.org/. Relays on my own fix to
# disqus ruby http://github.com/ecerulm/disqus/commit/91d5810c5fc6676f828a4fe17768e0e04b526bbe