Skip to content

Instantly share code, notes, and snippets.

View martisj's full-sized avatar
🐊

Martin Sjåstad martisj

🐊
View GitHub Profile
@martisj
martisj / activity.php
Created September 6, 2012 11:28
view that handles the different types of activities
<?if(count($groups) == 0) :?>
<div class="home_note">
<div class="home_bg">
<div class="inner_padding">
<div class="clear"></div>
<h1 class="uni">WHAT'S NEXT?</h1>
<p>As you and fellow students use UCROO relevant information will appear in this Home Feed.
In the mean time here are a few things you can do to get started.</p><br>
<ul>
<li>Check out the <?=anchor('classes','classes')?> - try posting a question!</li>
@martisj
martisj / _feed_connection.php
Created September 6, 2012 11:29
The part that generates the specific activity entry, i.e. the one that shows the connections between the current users friends.
<?
$friends_friend = repo('Users')->findOneBy(array('id'=>$notification->get_entity_id()));
$connected = array();
$displayed = array(); //used to prevent multiple classes being displayed
foreach($all_notifications as $connected_to)
{
// var_doctrine($connected_to);
// die();
$fid = $connected_to->get_user_from_id();
@martisj
martisj / kingofhearts.php
Created September 9, 2012 09:52
controller
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class KingOfHearts extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->template->title('The King of Hearts - A short story about whales and seagulls');
}
@martisj
martisj / config.php
Created September 9, 2012 09:57
config
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
# RewriteEngine on
# RewriteCond $1 !^(index\.php|images|assets|robots\.txt)
# RewriteRule ^(.*)$ index.php/$1 [L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
### Canonicalize codeigniter URLs
private function send_timetable_add_class($event, $calendar)
{
echo "send_timetable_add_class <br/>";
$user_from = $event->get_user();
$unit_info_id = $calendar->getUnit_info_id();
$qb = repo('Activity')->createQueryBuilder('a');
$qb->where('a.user_from_id = :ufid')
->andWhere('a.type = :type')
@martisj
martisj / notificationevent.php
Created September 21, 2012 07:34
meat poopsicle
private function _compare_timetable_events(models\Calendar $event_one, models\Calendar $event_two)
{
if ($event_one->getUnit_id() == $event_two->getUnit_id()
&& $event_one->getType() == $event_two->getType()
&& $event_one->getClass_type() == $event_two->getClass_type()
&& $event_one->getTime_from() == $event_two->getTime_from()
&& $event_one->getTime_to() == $event_two->getTime_to()
&& $event_one->getTime_day() == $event_two->getTime_day()
)
{
@martisj
martisj / gist:3976938
Created October 29, 2012 22:24
random balloon spawner
function spawnRandomBalloons(te:TimerEvent):void
{
var balloons:Array = [new mcBalloonPink(), new mcBalloonGreen(), new mcBalloonRed()];
var rndm:int = Math.floor(Math.random() * 3);
trace(balloons[rndm]);
trace(balloons);
var theBalloon = balloons[rndm];
theBalloon.x = 450;
@martisj
martisj / slideshow-gallery-pro.php
Created November 24, 2012 00:16
enqueue script hooks
@martisj
martisj / htaccess
Created November 25, 2012 22:27
messed up htaccess
# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php
RewriteEngine On
RewriteBase /
#For martinsjastad.com
# automatically redirect user to www.martinsjastad.com
RewriteCond %{HTTP_HOST} !^www\.martinsjastad\.com [NC]
RewriteRule ^(.*) http://www.martinsjastad.com/$1 [L,R=301]