Skip to content

Instantly share code, notes, and snippets.

View mramsden's full-sized avatar

Marcus Ramsden mramsden

View GitHub Profile
@mramsden
mramsden / Bootstrap.php
Created December 27, 2009 09:53
This gist shows an approach to using Twig with the Zend Framework.
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
/* Other functions may have been omitted */
protected function _initTwigView()
{
$twigView = new ZExt_Twig(APPLICATION_PATH, APPLICATION_PATH."/modules");
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper("ViewRenderer");
<div id="manageable_id_2" class="ep_manageable">
<div class="ep_manageable_data">
<input id="manageable_id_2_check" type="checkbox"> <a href="http://wlbr.local/2/">ZeroWIN Vision Conference</a>
</div>
<div class="ep_manageable_controls">
<ul>
<li>Manage Bookmark</li>
<li>Edit Resource</li>
<li>Delete Resource</li>
</ul>
<div id="manageable_id_102" class="ep_manageable">
<div class="ep_manageable_data">
<input type="checkbox" name="bulkaction_eprintids" value="102" id="select-102" class="ep_resource_manager_select_check">
<a href="http://resourcemanager.quango-vm.local/102/"><span class="ep_manageable_data_title">My New EdShare Resource</span></a>
<span class="ep_manageable_data_viewperms">Just me</span>
</div>
<div class="ep_manageable_controls">
<ul>
<li><a href="http://resourcemanager.quango-vm.local/102/">View</a></li>
<li><a href="http://resourcemanager.quango-vm.local/cgi/users/home?screen=EPrint::Edit&amp;eprintid=102">Edit</a></li>
@mramsden
mramsden / NSDictionary+QueryStringBuilder.h
Created May 14, 2011 15:38
Creating a query string from an NSDictionary.
#import <Foundation/Foundation.h>
@interface NSDictionary (QueryStringBuilder)
- (NSString *)queryString;
@end
@mramsden
mramsden / appstore.php
Created May 28, 2012 16:00 — forked from sebskuse/appstore.php
Simple PHP-CLI script to get number of ratings & stars of an app in the AppStore. Takes args from commandline & preset array.
<?php
error_reporting(0);
// Array of appstore ID's to always look up
$idArray = array(
"428243918",
"442713833"
);
$arguments = array_merge($idArray, array_slice($argv, 1) );
$(function() {
$(".sort_ajax").on("blur", function() {
var $this = $(this);
if ($this.attr("checked")) {
var data = {};
data.value = $this.siblings("[name='Style_code']").value();
$.post("Product_Range", data, function(data) {
$("#crud_page").trigger("change");
}, html);
}
android {
defaultConfig {
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
}
buildTypes {
debug {
versionNameSuffix "-SNAPSHOT"
}
@mramsden
mramsden / 0_reuse_code.js
Created January 31, 2014 10:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mramsden
mramsden / Package.swift
Last active October 31, 2016 21:51
Getting started with Kitura on Heroku
import PackageDescription
let package = Package(
name: "myFirstKituraProject",
dependencies: [
.Package(url: "https://github.com/IBM-Swift/Kitura.git", majorVersion: 1, minor: 0),
.Package(url: "https://github.com/IBM-Swift/HeliumLogger.git", majorVersion: 1, minor: 0),
]
)
@mramsden
mramsden / main.swift
Created October 31, 2016 21:51
A simple Kitua app
import Foundation
import Kitura
import HeliumLogger
// Initialize HeliumLogger
HeliumLogger.use()
// Create new router
let router = Router()