Skip to content

Instantly share code, notes, and snippets.

View jamesfinley's full-sized avatar

James Finley jamesfinley

View GitHub Profile
@jamesfinley
jamesfinley / Hi-res Graphic Mixin
Created August 10, 2011 13:51
A simple way to include both low-res and hi-res graphics for iOS/Desktop/etc.
@mixin hires-graphic($file, $type, $width, $height) {
$file_name: $file + '.' + $type;
$retina_name: $file + '_2x.' + $type;
@media (-webkit-min-device-pixel-ratio: 2) {
& {
background-image: url('../images/' + $retina_name);
-webkit-background-size: $width $height;
}
}
$variables = $this->input->post('variables');
if ($variables)
{
foreach ($variables as $key=>$variable)
{
$page->variable($key, $variable);
}
foreach ($page->template->template_variables->all() as $tv)
{
$v = $page->page_variables->first(array('name' => $tv->name));
$modules = $this->input->post('modules');
$this->db->where('page_id', $page->id)->delete('page_modules');
if ($modules)
{
foreach ($modules as $key=>$value)
{
$this->page_module_model->create(array(
'page_id' => $page->id,
'module_id' => $key
));
@jamesfinley
jamesfinley / find.php
Created July 2, 2011 14:17
Find Method Revisions
function find() {
}
$articles->find(array(
'conditions' => array(),
'page' => 1
));
$articles->find(array(
'conditions' => array('blog_id' => 1),
@mixin position($top: false, $left: false, $bottom: false, $right: false) {
position: absolute;
@if type_of($top) == number {
top: $top;
}
@if type_of($left) == number {
left: $left;
}
@if type_of($bottom) == number {
bottom: $bottom;
var obj = function () {
var secret = 'hello';
return {
set: function (value) {
secret = value;
},
get: function () {
return secret;
}
};
The return:
jsonp1236697409343(<html>
SyntaxError: Parse error
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx/0.7.17</center>
</body>
</html>
);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$.getJSON('http://api.new.youversion.com/1.0/bible/books.json', {
'callback': 'processBooks'
});