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
@rascoop
rascoop / clearcachecakephp
Created September 23, 2012 23:35
clear cache cakephp in linux
rm -f ./app/tmp/cache/models/cake_model_*
rm -f ./app/tmp/cache/persistent/cake_core_*
@rascoop
rascoop / boxshadowfromabove
Created September 24, 2012 01:20
Shadow Box from Above
border: 1px solid black;
background-image: -webkit-gradient(linear, center top, center bottom, from(#fcfcfc), to(#bfbfbf), color-stop(3%, #f7f7f7), color-stop(12%, #f2f2f2), color-stop(90%, #d9d9d9));
background-image: -webkit-linear-gradient(top, #fcfcfc, #f7f7f7 3%, #f2f2f2 12%, #d9d9d9 90%, #bfbfbf);
background-image: -moz-linear-gradient(top, #fcfcfc, #f7f7f7 3%, #f2f2f2 12%, #d9d9d9 90%, #bfbfbf);
background-image: -o-linear-gradient(top, #fcfcfc, #f7f7f7 3%, #f2f2f2 12%, #d9d9d9 90%, #bfbfbf);
background-image: -ms-linear-gradient(top, #fcfcfc, #f7f7f7 3%, #f2f2f2 12%, #d9d9d9 90%, #bfbfbf);
@rascoop
rascoop / shadowboxfromabove2
Created September 24, 2012 01:23
Shadow Box from Above - Different Take
-webkit-box-shadow: 0px 7px 3px 3px #b0b0b0;
box-shadow: 0px 7px 3px 3px #b0b0b0;
<?php
if (!isset($modules)) {
$modulus = 11;
}
if (!isset($model)) {
$models = ClassRegistry::keys();
$model = Inflector::camelize(current($models));
}
?>
<div class="pagination">
<?php
class BootstrapFormHelper extends AppHelper {
public $helpers = array('Html', 'Form');
public function input($name, $options = array()) {
$default = array(
'type' => null,
'label' => null,
'before' => null, // to convert .input-prepend
<?php
App::uses('FormHelper', 'View/Helper');
/**
* BootstrapFormHelper.
*
* Applies styling-rules for Bootstrap 3
*
* To use it, just save this file in /app/View/Helper/BootstrapFormHelper.php
* and add the following code to your AppController:
<!-- Note: You'll have to use Modernizr to detect 3d transform support -->
<!--- HTML --->
<div class="books">
<div id="book1" class="book">
<img src="book4.jpg" />
</div>
<div id="book2" class="book">
<img src="book2.jpg" />
</div>
$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",
function csvQuoteCell(cell, quotechar, sepchar) {
// quote cells containing sepchar and double quote chars
// this is an excel dialect
var quoted = cell;
if (cell.indexOf(sepchar)!==-1) {
if (cell.indexOf(quotechar)!==-1) {
quoted = quoted.replace(quotechar, quotechar+quotechar);
}
quoted = quotechar+quoted+quotechar;
}
testCSV = function(){
var csvData = "";
db.transaction(function(tx){
tx.executeSql('SELECT * FROM grocery', [], function (tx, results){
var len = results.rows.length, i;
for (i = 1; i < len; i++) {
csvData += results.rows.item(i).itemno + "," + results.rows.item(i).quantity + "\n";
}
window.location='data:application/webcsv;charset=utf8,' + encodeURIComponent(csvData);