Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
EdwardIII / j.js
Last active December 15, 2015 04:59
var Finder = function(){
var self = this;
self.data = ko.observable();
self.selectedCategory = ko.observable();
self.categories = ko.observable([]);
self.loadCategories = function(categories){
ko.mapping.fromJS(categories.objects, {}, self.categories);
}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
<?php
/* build query */
$c = $modx->newQuery('fmzForms');
$c->where(array(
'id' => 1
));
$form = $modx->getObjectGraph('fmzForms', array(
'Fields' => array(
'Validation' => array()
function get_quote_from_http($in_filename){
$ch = curl_init($in_filename);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, $fp);
$result = curl_exec($ch);
curl_close($ch);
return $result;
SOUTH_MIGRATION_MODULES = {
'page': 'yourapp.migrate.page',
'medialibrary': 'yourapp.migrate.medialibrary', # if you are using the medialibrary
# which comes with FeinCMS
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@EdwardIII
EdwardIII / j.js
Last active December 14, 2015 19:28
$(function(){
ko.bindingHandlers.disableAndThrob = {
init: function(element, valueAccessor) {
if (valueAccessor()){
var valueUnwrapped = ko.utils.unwrapObservable(valueAccessor());
if(valueUnwrapped){
$(element).attr('disabled', 'disabled');
$(element).before('<img src="/assets/images/loading.gif" width="16" height="16" class="loading-throbber">');
}
$ git log -S json2.js
commit f41247583901a831d78f6da78e43d707c3e5f8f5
Author: Edward <[email protected]>
Date: Fri Mar 8 15:29:42 2013 +0000
Moved JS 3rd party into vendor dir and all js calls to bottom of page except jq
commit becf3c80f460e3c1697406df48289c9a01bd7f1e
Author: Edward <[email protected]>
Date: Sun Mar 3 09:24:38 2013 +0000
@EdwardIII
EdwardIII / f.py
Last active December 14, 2015 19:08
import datetime
from django.db import models
from django.contrib.auth.models import User
from django.db.models import Sum
from django.db.models.signals import post_init
from django import forms
from django.utils.translation import ugettext_lazy as _
from feincms.module.page.models import Page
from feincms.content.richtext.models import RichTextContent
Creating test database for alias 'default'...
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/edward/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/home/edward/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/edward/python/lib/python2.7/site-packages/django/core/management/commands/test.py", line 49, in run_from_argv
super(Command, self).run_from_argv(argv)