Skip to content

Instantly share code, notes, and snippets.

View DevJohnC's full-sized avatar

John Carruthers DevJohnC

View GitHub Profile
I/ActivityManager( 121): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/
com.android.launcher2.Launcher }
W/InputManagerService( 121): Ignoring hideSoftInput of: com.android.internal.vi
ew.IInputMethodClient$Stub$Proxy@45dcdd90
D/Warhol ( 218): A pack appears to be installed -- skipping Installer
D/PhoneInterfaceManager( 215): [PhoneIntfMgr] CMD_END_CALL: no call to hang up
D/WindowManager( 121): I'm tired mEndcallBehavior=0x2
I/power ( 121): *** set_screen_state 0
D/LockScreen( 121): Updating Lock Screen text to Ruim
using FubuMVC.Core;
namespace EducationWeb.AssetsMap
{
public class ConfigureFubuMVC : FubuPackageRegistry
{
public ConfigureFubuMVC()
{
Applies.ToAssemblyContainingType<ConfigureFubuMVC>().ToAllPackageAssemblies();
public class ModelTest : DynamicModel
{
public ModelTest()
: base("pgtest", "\"ModelTest\"", "id")
{
}
}
public class ModelTestRecord
{
[TableName("\"ModelTest\"")]
[PrimaryKey("id")]
public class ModelTest
{
public int id { get; set; }
public string test1 { get; set; }
public string test2 { get; set; }
}
public static class ExpandoCasting
[ServiceDirectory("/examples")] // cause the request to be handled at /servicestack/{FORMAT}/syncreply/examples/HelloWorld
public class HelloWorldService : IService<HelloWorld>
{
public object Execute(HelloWorld request)
{
return new HelloWorldResponse() { Text = "Hello World" };
}
}
@DevJohnC
DevJohnC / gist:2991902
Created June 25, 2012 22:40
How templates should probably work
<html>
<head>
<title>Home :: <? Theme::store_name() ?></title>
</head>
<body>
<h1><? Theme::store_name() ?></h1>
<h2>Home</h2>
<p>Welcome to the store!</p>
<? // here specials are products flagged as on sale or something in the admin and the loop is provided by the system
@DevJohnC
DevJohnC / gist:2991930
Created June 25, 2012 22:46
Filtering specials
<?php
// in functions.php?
Hooks::addFilter('specials_filter', 'filterTheSpecials');
function filterTheSpecials($filter)
{
// limit to physical products only
$filter->limitTo('PhysicalProduct');
// or limit to the Computer category
$filter->limitTo('Category', 'Computer');
@DevJohnC
DevJohnC / gist:3087578
Created July 11, 2012 02:35
First version of cupcart entities tables
-- phpMyAdmin SQL Dump
-- version 3.3.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 10, 2012 at 09:39 PM
-- Server version: 5.0.84
-- PHP Version: 5.3.8-pl0-gentoo
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@DevJohnC
DevJohnC / gist:3251469
Created August 3, 2012 21:00
python oauth request
url = "etrade request credentials url"
consumer = oauth.Consumer(key="your consumer key", secret="your secret")
params = {
'oauth_nonce': oauth.generate_nonce(),
'oauth_timestamp': int(time.time()),
'oauth_callback': 'oob',
'oauth_consumer_key': consumer.key
}
req = oauth.Request(method="POST", url=url, parameters=params)
public class Artist : BaseRequestDTO
{
/// <summary>
/// Limit results to the specified region.
/// </summary>
public int RegionId { get; set; }
/// <summary>
/// Only fetch featured artists.
/// </summary>
public bool Featured { get; set; }