Skip to content

Instantly share code, notes, and snippets.

View dacresni's full-sized avatar
🏠
Working from home

Nehemiah I. Dacres dacresni

🏠
Working from home
View GitHub Profile
class SoapServiceController < ApplicationController
include WashOut::SOAP
soap_action "print_params", :args => {
:circle => {
:center => {
:x => :integer,
:y => :integer
},
:radius => :double
@ys
ys / stored_procedure_service.rb
Created September 13, 2012 12:50
Execute stored procedure
class StoredProcedureService
def self.instance
@instance ||= StoredProcedureService.new
end
def execute(name, *args)
results = []
begin
connection.execute("CALL #{name}(#{args.join(',')})").each(as: :hash, symbolize_keys: true) do |row|
@gglanzani
gglanzani / gist:3378381
Created August 17, 2012 12:14
Applescript for MacVim to compile a .tex file with latexmk
on findAndReplace(tofind, toreplace, TheString)
set ditd to text item delimiters
set res to missing value
set text item delimiters to tofind
repeat with tis in text items of TheString
if res is missing value then
set res to tis
else
set res to res & toreplace & tis
end if
@LeonB
LeonB / serve.sh
Created July 30, 2012 21:03
One-line bash http server
:;while [ $? -eq 0 ];do nc -vlp 8080 -c'(r=read;e=echo;$r a b c;z=$r;while [ ${#z} -gt 2 ];do $r z;done;f=`$e $b|sed 's/[^a-z0-9_.-]//gi'`;h="HTTP/1.0";o="$h 200 OK\r\n";c="Content";if [ -z $f ];then($e $o;ls|(while $r n;do if [ -f "$n" ]; then $e "<a href=\"/$n\">`ls -gh $n`</a><br>";fi;done););elif [ -f $f ];then $e "$o$c-Type: `file -ib $f`\n$c-Length: `stat -c%s $f`";$e;cat $f;else $e -e "$h 404 Not Found\n\n404\n";fi)';done
@joelverhagen
joelverhagen / README.md
Created February 12, 2012 02:14
Jekyll YouTube Embed Plugin

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
@nbareil
nbareil / googleplus_widget.html
Created October 5, 2011 09:15
my Google+ widget used for blogspot
<ul id="buzzcontent">
</ul>
<script>
function handler(response) {
for (var i = 0; i < 5 && i < response.items.length; i++) {
var item = response.items[i];
document.getElementById("buzzcontent").innerHTML += "<li><a href=\"" + item.url + "\">" + item.title + "</a></li>";
}
}
@feliperazeek
feliperazeek / build.xml
Created September 8, 2011 16:40
Ant Build for Play Framework Scala Modules
<?xml version="1.0" encoding="UTF-8"?>
<project name="Perks Security" default="build" basedir=".">
<path id="project.classpath">
<fileset dir="${play.path}/framework">
<include name="*.jar"/>
</fileset>
<fileset dir="${play.path}/framework/lib">
<include name="*.jar"/>