Skip to content

Instantly share code, notes, and snippets.

@rutcreate
rutcreate / index.html
Created August 5, 2010 03:52
JavaScript Learning with P'Pok
We couldn’t find that file to show.
@rutcreate
rutcreate / model.py
Created November 10, 2010 05:08
ExtJS with Django
from django.db import models
class Mail(models.Model):
subject = models.CharField(max_length=255)
message = models.TextField()
sender = models.EmailField()
created = models.DateTimeField(auto_now_add=True)
@rutcreate
rutcreate / RCAnimatedSprite.h
Created October 23, 2012 14:04
Sparrow: Animated Sprite with MovieClip
#import <Foundation/Foundation.h>
@class SPSprite;
@class SPMovieClip;
@interface RCAnimatedSprite : SPSprite <SPAnimatable> {
NSMutableDictionary *mAnimations;
SPMovieClip *mCurrentMovieClip;
NSString *mCurrentAnimation;
SPJuggler *mJuggler;
@rutcreate
rutcreate / migrate_image_styles.php
Created December 18, 2012 07:08
Migrate ImageCache from D6 to Image Style D7
<?php
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
function imagecache_preset_actions($preset, $reset = FALSE) {
$actions_cache = array();
$result = db_query('SELECT * FROM {imagecache_action} where presetid = '.$preset['presetid'].' order by weight' );
foreach ($result as $row ) {
<?php
$menu = array(
'menu_name' => 'custom-menu',
'title' => t('My custom menu'),
'description' => t('The <em>Custom</em> menu contains links for testing only.'),
);
menu_save($menu);
<html>
<head>
<script type="text/javascript">
function post() {
FB.getLoginStatus(function(response) {
FB.ui({
method: 'feed',
name: 'Enter name here', // configurable
caption: 'Caption here', // configurable
description: 'Description', // configurable
@rutcreate
rutcreate / TestRegisterForm.php
Last active December 11, 2015 17:48
PHPUnit Selenium
<?php
class TestRegisterForm extends PHPUnit_Extensions_Selenium2TestCase {
public function setUp() {
$this->setHost('localhost');
$this->setPort(4444);
$this->setBrowser('firefox');
$this->setBrowserUrl('http://localhost/');
}
#!/bin/sh
#================================================================================
# virtualhost.sh
#
# A fancy little script to setup a new virtualhost in Mac OS X.
#
# If you want to delete a virtualhost that you've created, you need to:
#
# sudo ./virtualhost.sh --delete <site>
#
@rutcreate
rutcreate / config.lua
Last active May 7, 2016 04:24
[Corona SDK] Support all screens resolution.
application =
{
content =
{
scale = "letterBox",
xAlign = "center",
yAlign = "center",
imageSuffix =
{
["-2x"] = 1.5,
@rutcreate
rutcreate / random_point_on_disk.js
Created February 5, 2015 16:11
Random point on Disk
function getPointOnDisk(radius) {
var a = Math.random(),
b = Math.random();
if (b < a) {
c = b;
b = a;
a = c;
}