Skip to content

Instantly share code, notes, and snippets.

View geon's full-sized avatar

Victor Widell geon

View GitHub Profile
@geon
geon / backbone.local-buffered.js
Created December 10, 2013 13:05
Experimenting with a LocalStorage buffer for backbone in case of dropped connection.
"use strict";
var LocalBuffered = {};
LocalBuffered.Model = Backbone.Model.extend({
constructor: function () {
Backbone.Model.apply(this, arguments);
<?php
$content = '
Text with newlines, possible XSS attacks and URLs.
<script type="text/javascript">alert("this could be an XSS attack.");</script>
The URL to my github page is https://github.com/geon.
';
@geon
geon / app_model.php
Created September 2, 2011 16:51
Get actual integers from MySQL with CakePHP.
<?php
class AppModel extends Model {
function afterFind($results){
if(!isset($results[0])){
// $results is a single object.
$results = $this->realAfterFind($results);
@geon
geon / ellipsis.htm
Created November 20, 2010 21:07
Textshortening and ellipsis with only CSS
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Textshortening and ellipsis with only CSS</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style type="text/css">
p {
width: 220px;
line-height: 18px;