Skip to content

Instantly share code, notes, and snippets.

/* play.c */
#include "mp2.h"
/***************************************************************** shuffle *****************************************************************************************/
void shuffle(int cards[][12], int num_cards[], int drawnDeck[])
{
@kesne
kesne / villo.wp7.js
Created May 13, 2012 01:07
An attempt to fix compatibility problems with Villo 0.9.9 and WP7.
villo.ajax = function (url, modifiers) {
//Set up the request.
var vAJ = new XMLHttpRequest();
if (vAJ) {
var request = new XMLHttpRequest();
if ("withCredentials" in request) {
//Good Browsers
//Line up the variables to be sent.
var sendingVars = "";
@kesne
kesne / store.js
Created May 13, 2012 02:48
Storage replacement for villo.js.
store = {
set: function(name, value, days){
var expires = ""
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
}
document.cookie = name+"="+value+expires+"; path=/";
},
@kesne
kesne / game.js
Created May 15, 2012 06:18
Example of villo.Game in villoJS.
​var mmo = new villo.Game({
//Give it some name. This doesn't really make a big difference:
name: "mmo"​​​,
//The type defines how it behaves. All is a safe type to use in most cases.
type: "all",
//This defines what features we want to import. In this example, we're only using data.
use: ["data"],
//Define some events for the system:
events: {
​​​​​​​​//Define the function that is called when data data is received from the data.interval function later on.
@kesne
kesne / slade.js
Created May 27, 2012 01:15
Villo Books "Slade" Transition
enyo.Book.transition({
name: "slade",
auto: true,
directional: true,
transition: {
duration: 500,
next: {
visible: {
opacity: 1,
transform: {
@kesne
kesne / transition.js
Created May 27, 2012 04:18
Comprehensive overview of adding book transitions.
enyo.Book.transition({
//Name of the transition:
name: "everything",
//Using this will set up the step function, automatically transitioning between values.
//If you don't set this as true, you're expected to provide your own step function.
auto: true,
//Set it up to use next/back animations.
directional: true,
//Set the easing function. The default is enyo.easing.quadInOut. You can also define your own easing function here.
easing: enyo.easing.quadInOut,
package net.keenstudios.orient;
import org.apache.cordova.api.PluginResult;
import org.json.JSONArray;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.Environment;
import com.phonegap.api.Plugin;
@kesne
kesne / accordion.js
Last active December 17, 2015 22:19
Device Details Compatibility Layer
// Create a new YUI instance and populate it with the required modules.
YUI().use('node', 'event', function (Y) {
// Node is available and ready for use. Add implementation
// code here.
var allPanels = Y.all('.accordeonContainer > .accordeonContent').hide();
var panelHeaders = Y.all('.accordeonContainer > h2');
panelHeaders.on('click', function(e) {
//Get the parent node:
@kesne
kesne / app.js
Created January 11, 2014 05:03
Fact.JS Demo
//Create app view:
fact.view('app', {
//called on render of the view:
render: function(elem){
//Set up the fact.js router with the app view. We could make this call anywhere, such as after the render, but it's easy here because we have reference to the just-created element (elem).
fact.router({
//The element that we want the router to apply to. In this case, it's the outlet
element: elem.$('.outlet'),
//Routes that we specify:
import { registerExtension } from './extensionManager';
function createNamespacingMiddleware(reducerKey, reducerNamespace) {
return () => next => (action) => {
const namespacedAction = action;
namespacedAction.meta = {
...action.meta,
withNamespace: {
reducerKey,