Skip to content

Instantly share code, notes, and snippets.

@martisj
martisj / gist:2004450
Created Mar 9, 2012
animated gif not replacing background image
View gist:2004450
var image = new Image();
image.src = "<?php echo base_url('assets/img/layout/upload_form_loading.gif'); ?>";
$('#submit-button').click(function() {
$(this).css('background-image', 'url(' + image + ')');
console.log($(this).css('background-image'));
$(this).unbind('click');
});
@martisj
martisj / template.php
Created Mar 11, 2012
dynamic template view
View template.php
<?php $this->load->view('header', $header); ?>
<?php $this->load->view($main_content); ?>
<?php $this->load->view('footer', $footer); ?>
@martisj
martisj / template.php
Created Mar 11, 2012
array is getting output on top and bottom of page
View template.php
<?php $this->load->view('includes/header', $header); ?>
<?php $this->load->view($view_to_load, $main_content); ?>
<?php $this->load->view('includes/footer', $footer); ?>
View embed_fonts.css
@font-face {
font-family: 'DINWeb';
src: url('fonts/DINWeb.eot');
src: local('☺'),
url('fonts/DINWeb.woff') format('woff');
}
@font-face {
font-family: 'DINWeb';
src: url('fonts/DINWeb-Bold.eot');
@martisj
martisj / site.php
Created Mar 14, 2012
fatty bloat contoller
View site.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Site extends CI_Controller {
private $data;
private $user_id;
private $tab_url;
function __construct() {
parent::__construct();
@martisj
martisj / template.php
Created Mar 15, 2012
template engine for the win
View template.php
<?php $this->load->view('includes/header', (isset($header) ? $header : '')); ?>
<?php $this->load->view($view_to_load, (isset($main_content) ? $main_content : '')); ?>
<?php $this->load->view('includes/footer', (isset($footer) ? $footer : '')); ?>
@martisj
martisj / Upload.php
Created Mar 18, 2012
Finn feilen, neida, finn ut hvor den sjekker filtype. Må da endre til at man skal poste direkte til facebook hvis det er mime type video/* og til serveren hvis det er mp3.
View Upload.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
@martisj
martisj / crashlog
Created Mar 21, 2012
crash log for sublimetext2
View crashlog
Process: Sublime Text 2 [1454]
Path: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2
Identifier: com.sublimetext.2
Version: Beta, Build 2181 (2181)
Code Type: X86-64 (Native)
Parent Process: launchd [231]
Date/Time: 2012-03-21 16:58:39.582 +1100
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6
@martisj
martisj / brew_doc_errors.log
Created Apr 2, 2012
brew doctor error messages
View brew_doc_errors.log
Warning: gettext was detected in your PREFIX.
The gettext provided by Homebrew is "keg-only", meaning it does not
get linked into your PREFIX by default.
If you `brew link gettext` then a large number of brews that don't
otherwise have a `depends_on 'gettext'` will pick up gettext anyway
during the `./configure` step.
If you have a non-Homebrew provided gettext, other problems will happen
@martisj
martisj / gist:2281364
Created Apr 2, 2012
gettext crash log
View gist:2281364
Process: gettext [37907]
Path: /usr/local/bin/gettext
Identifier: gettext
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: zsh [18406]
Date/Time: 2012-04-02 17:06:53.289 +1000
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6