Skip to content

Instantly share code, notes, and snippets.

View rascoop's full-sized avatar

Richard Scoop rascoop

  • Curaçao, Dutch Caribbean
View GitHub Profile
@m3nt0r
m3nt0r / default.tpl
Created September 21, 2010 05:58
TwigView for CakePHP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
{{ html.charset() }}
<title>{{ 'CakePHP: the rapid development php framework'|trans }}: {{ title_for_layout }}</title>
{{ html.meta('icon') }}
{{ html.css('cake.generic') }}
{{ scripts_for_layout }}
</head>
<body>
anonymous
anonymous / for_m3nt0r.tpl
Created October 5, 2010 05:52
{{[
html.docType,
html.tag( 'html',[
html.tag( 'head',[
html.charset,
html.tag( 'title', title_for_layout|trans ),
html.css([
'cake.generic'
], null, [ 'media' : 'screen, projection' ]),
html.script([
@josegonzalez
josegonzalez / deploy.rb
Created October 23, 2010 16:40
Capistrano Deploy Script for CakePHP applications using GIT (Update the $config hash))
$config = {
"application" => "DOMAIN.TLD",
"repository" => "git@GITHOST:USERNAME/REPOSITORYNAME.git",
"remoteusername" => "REMOTEUSERNAME",
"cake_folder" => "/PATH/TO/CAKE",
"cake_version" => "cakephp1.3",
"plugin_dir" => "plugins",
"servers" => {
"prod" => {
"server" => "APPLICATION.TLD",
@barend
barend / gist:1018771
Created June 10, 2011 12:44
Burgerservicenummer Elfproef Validator
/** Validate BSN according to http://nl.wikipedia.org/wiki/Burgerservicenummer */
private boolean isValidBSN(int candidate) {
if (candidate <= 9999999 || candidate > 999999999) {
return false;
}
int sum = -1 * candidate % 10;
for (int multiplier = 2; candidate > 0; multiplier++) {
int val = (candidate /= 10) % 10;
sum += multiplier * val;
@rmarimon
rmarimon / README
Created August 13, 2011 17:10
Dial Chart examples
Dial Chart examples. Suggestions and enhancements are welcome.
@slywalker
slywalker / pagination.ctp
Created October 5, 2011 07:25
pagination element for CakePHP on twitter bootstrap
<?php
if (!isset($modules)) {
$modulus = 11;
}
if (!isset($model)) {
$models = ClassRegistry::keys();
$model = Inflector::camelize(current($models));
}
?>
<div class="pagination">
@jmwenda
jmwenda / gist:2008550
Created March 9, 2012 20:37
kml to svg
import mapnik
import cairo
m = mapnik.Map(15000, 15000, "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs") # end result: OpenStreetMap projection
m.background = mapnik.Color(0, 0, 0, 0)
bbox = mapnik.Envelope(-10000000, 2000000, -4000000, -19000000) # must be adjusted
m.zoom_to_box(bbox)
s = mapnik.Style()
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@akumria
akumria / find-forks.py
Last active March 9, 2024 01:39
A quick way to find all the forks of a particular github project. see: https://github.com/akumria/findforks for a version which works now
#!/usr/bin/env python
import os
import urllib2
import json
import subprocess
user=None
repo=None
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"