Skip to content

Instantly share code, notes, and snippets.

View hobodave's full-sized avatar
🎯
Focusing

David Abdemoulaie hobodave

🎯
Focusing
View GitHub Profile
SELECT COUNT( DISTINCT t.id ) AS num_results
FROM tickets t
LEFT JOIN companies c ON t.company_id = c.id
WHERE t.parent_id =0
AND t.company_id =6
AND (
t.ticket_status NOT
IN ( 3, 4, 7 )
)
GROUP BY t.id
<?php
/**
* Hobo
*
* LICENSE
*
* Copyright (c) 2008 David Abdemoulaie
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :login, :password, :email, :null => false
t.timestamps
end
end
<?php
/**
* SpellCheck
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://hobodave.com/license.txt
<?php
set_include_path('./lib:.');
include 'lib/Zend/Loader.php';
Zend_Loader::registerAutoload();
$server = new Zend_Json_Server();
$server->setClass('SpellCheck');
if ('GET' == $_SERVER['REQUEST_METHOD']) {
$server->setTarget('/spell/json-rpc.php')
var SpellChecker = Class.create({
initialize: function(url, callback, options) {
this.url = url;
this.callback = callback;
this.options = {
rpcRequest: {
jsonrpc:"2.0",
method:"",
params: [],
id: Math.floor(Math.random() * 100)
var fb = function(transport) {
console.log(transport.responseJSON);
}
var sc = new SpellChecker('/spell/json-rpc.php', fb);
sc.check('sevne');
{
"result":false,
"id":"48",
"jsonrpc":"2.0"
}
{
"result": ["seven","Sven","Severn","Seine","seine","Steven","scene","seen","Even","even","serve","serving"
,"sever","sieve","sieving","sevens","Sen","Sivan","Svend","sen","Keven","semen","seiner","Levine","Selene"
,"Seline","Serene","Sterne","serene","severe","Savina","Sean","Sena","sane","save","saving","sewn","sine"
,"Ferne","Seana","senna","Sven's","seven's"],
"id":"48",
"jsonrpc":"2.0"
}
sc.checkText('Four score and sevne years ago our fathres brought forth on this continnent a new nation.');