Skip to content

Instantly share code, notes, and snippets.

@tmzt
tmzt / gist:828945
Created February 16, 2011 06:07
snippet of app.js
app.post('/apis/v0/checkemail.json', function(req, res) {
var email = req.body.email;
checkemail(email, function(result) {
console.log('result: ', result);
if (result != null && result.shorturl != '') {
console.log('shorturl: ', result.shorturl);
//res.writeHead(200, {'Content-Type': 'application/json'});
//res.end(JSON.stringify(result));
console.log('json: ', JSON.stringify({html: result.html}));
$catId = $catIds[$catno];
$cat = Mage::getModel('catalog/category')->load($catId);
//$coll = Mage::getResourceModel('reports/product_collection')
$coll = Mage::getModel('catalog/product')->getCollection();
//$coll->addAttributeToFilter('category_ids',array('finset'=>explode(',',array($catId)));
// $coll->addFieldToFilter('category_ids',array('finset'=>explode(',',array($catId)) ));
// $coll->addFieldToFilter('category_ids',array('finset'=>explode(',',array($catId))));
// $coll->addFieldToFilter('featured',array(
#include "../android.h"
#include <stdio.h>
#include <sys/socket.h>
#include <sys/stat.h>
static pthread_mutex_t miEventQueueMutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t events_lock = PTHREAD_MUTEX_INITIALIZER;
jint
package net.homeip.ofn.nativemarket;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
/*
Copyright 2010 Timothy Meade
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
package net.homeip.ofn.androix;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.view.View;
import android.content.BroadcastReceiver;
import android.content.Context;
#include <jni.h>
#ifdef HAVE_CONFIG_H
#include <kdrive-config.h>
#endif
#include "private.h"
#include <inputstr.h>
#include <mi.h>
@tmzt
tmzt / screen.c
Created October 26, 2010 16:14
screen.c
#include <X11/X.h>
#include <X11/Xproto.h>
#include "os.h"
#include "servermd.h"
#include "inputstr.h"
#include "scrnintstr.h"
#include "mibstore.h" // mi backing store implementation
#include "mipointer.h" // mi software cursor
#include "micmap.h" // mi colormap code
/*
* Copyright © 2004 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kobject.h>
#include <linux/platform_device.h>
#include "../fs/sysfs/sysfs.h"
struct kobject *pbus_kobject;
struct sysfs_dirent *sd;
struct sysfs_dirent *dir;