Skip to content

Instantly share code, notes, and snippets.

@virasak
virasak / SQLiteDialect.java
Created January 29, 2009 07:26
SQLite dialect for Hibernate
/*
* The author disclaims copyright to this source code. In place of
* a legal notice, here is a blessing:
*
* May you do good and not evil.
* May you find forgiveness for yourself and forgive others.
* May you share freely, never taking more than you give.
*
*/
package org.hibernate.dialect;
@endolith
endolith / Has weird right-to-left characters.txt
Last active June 1, 2024 10:58
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@secretfader
secretfader / hexlify_ruby.rb
Created August 22, 2009 19:17
Hexlify in Ruby
def hexlify(msg)
msg.split("").collect { |c| c[0].to_s(16) }.join
end
def unhexlify(msg)
msg.scan(/../).collect { |c| c.to_i(16).chr }.join
end
puts hexlify("Hello World")
@mikedamage
mikedamage / split_str.sql
Created January 15, 2010 03:24
MySQL string split function
-- SPLIT_STR MySQL Function
-- from http://blog.fedecarg.com/2009/02/22/mysql-split-string-function/
CREATE FUNCTION SPLIT_STR(
x VARCHAR(255),
delim VARCHAR(12),
pos INT
)
RETURNS VARCHAR(255)
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(x, delim, pos),
@allen501pc
allen501pc / [C++] Multiple key with unique property (implemented by STL:map)
Created January 22, 2010 09:50
Multiple key with unique property (implemented by STL:map)
#include <iostream>
#include <map>
using namespace std;
class object ;
class object
{
public:
static int count;
int value1;
@ghoseb
ghoseb / ns-cheatsheet.clj
Last active May 20, 2024 13:01 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
@kares
kares / FileGlob.groovy
Created February 21, 2010 13:45
Globbing implemented in Groovy
// Licensed under the "Apache License, Version 2.0" (c) 2010
/**
* Returns filenames found by expanding the passed pattern which is String or
* a List of patterns.
* NOTE: that this pattern is not a regexp (it’s closer to a shell glob).
* NOTE: that case sensitivity depends on your system.
*
* <code>*</code> Matches any file. Can be restricted by other values in
* the glob pattern (same as <code>.*</code> in regexp).
* <code>*</code> will match all files,
@pklaus
pklaus / gist:319524
Created March 2, 2010 14:10
Greasemonkey User Script to download PDF files posted in a WebCT class folder
// Frankfurt University WebCT Downloader
// 17-05-2008
// Copyright (c) 2008, Marc Powell <marc DOT powell AT yahoo DOT com>
//
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// Allows Iowa State University distance-education students to download
~/projects/jruby ➔ cat blah.rb
class MyClass
def foo
puts 'hello'
end
end
~/projects/jruby ➔ jrubyc --javac blah.rb
Generating Java class MyClass to /Users/headius/projects/jruby/MyClass.java
javac -d /Users/headius/projects/jruby -cp /Users/headius/projects/jruby/lib/jruby.jar:. /Users/headius/projects/jruby/MyClass.java
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {