Skip to content

Instantly share code, notes, and snippets.

View martisj's full-sized avatar
🐊

Martin Sjåstad martisj

🐊
View GitHub Profile
@martisj
martisj / gist:2004450
Created March 9, 2012 01:11
animated gif not replacing background image
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 March 11, 2012 09:07
dynamic template view
<?php $this->load->view('header', $header); ?>
<?php $this->load->view($main_content); ?>
<?php $this->load->view('footer', $footer); ?>
@martisj
martisj / template.php
Created March 11, 2012 11:18
array is getting output on top and bottom of page
<?php $this->load->view('includes/header', $header); ?>
<?php $this->load->view($view_to_load, $main_content); ?>
<?php $this->load->view('includes/footer', $footer); ?>
@martisj
martisj / embed_fonts.css
Created March 14, 2012 05:11
font embeddation
@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 March 14, 2012 11:38
fatty bloat contoller
<?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 March 15, 2012 12:51
template engine for the win
<?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 March 18, 2012 18:28
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.
<?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 March 21, 2012 06:01
crash log for sublimetext2
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 April 2, 2012 03:57
brew doctor error messages
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 April 2, 2012 07:13
gettext crash log
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