Skip to content

Instantly share code, notes, and snippets.

View BobuSumisu's full-sized avatar

Øyvind Ingvaldsen BobuSumisu

View GitHub Profile
@BobuSumisu
BobuSumisu / Angular newline list directive
Last active December 21, 2015 19:28
A simple AngularJS directive for newline separated lists. Works much like the ngList directive but with newlines instead of commas.
module.directive('ngListNewline', function() {
return {
restrict: 'A',
require: 'ngModel',
link: function(scope, element, attr, ngModel) {
ngModel.$parsers.push(function(text) {
return text.split('\n').filter(function(x) { return x.trim().length > 0 });
});
ngModel.$formatters.push(function(array) {
* Juss24
** Backend
*** Slim
The project uses the microframework [[http://slimframework.com][Slim]].
Every request is rewritten to =index.php=. In this file a Slim Application object is instantiated
called =$app=.
To create a route simple call =$app->VERB()=
where =VERB= is a HTTP Request method (=get=, =post=, =put= or =delete=).
To create a generic route use =map()=.
@BobuSumisu
BobuSumisu / adm.js
Created August 16, 2012 08:37
front-end-kode til et lite adminpanel (IN PROGRESS)
function setup() {
$.ajaxSetup({
url: 'php/ajax.php',
type: 'post',
dataType: 'json',
beforeSend: function() {
$('#ajax_loader').dialog({ modal: true });
},
@BobuSumisu
BobuSumisu / gist:1605307
Created January 13, 2012 09:43
asteroids 0.1
window.onload = function() {
Crafty.load(["../../Pix/ship1.png", "../../Pix/bullet.png"], function () {
init();
});
function init() {
Crafty.init(WIDTH, HEIGHT);
// Crafty.canvas.init();
@BobuSumisu
BobuSumisu / gist:1415615
Created December 1, 2011 10:22
jqplot problem
$.jqplot(container, [data], {
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barPadding: 0,
barMargin: 0,
barWidth: 10
},
},
axes: {
@BobuSumisu
BobuSumisu / Current (working) Xorg.conf
Created October 5, 2011 20:39
Nvidia Drivers Failed
Section "Device"
Identifier "Default Device"
Option "NoLogo" "True"
EndSection
CC=g++
CFLAGS=-c -Wall
LDFLAGS=
SRC=main.cpp
OBJ=$(SRC:.cpp=.o)
EXE=main
VPATH=src/
BUILDDIR=build
@BobuSumisu
BobuSumisu / gist:911331
Created April 9, 2011 11:38
/proc/partitions
major minor #blocks name
8 0 976762584 sda
8 1 547312640 sda1
8 3 1 sda3
8 5 7812096 sda5
8 6 421634048 sda6
Boot Info Script 0.56 from 8 February 2011
============================= Boot Info Summary: ===============================
=> Grub2 (v1.97-1.98) is installed in the MBR of /dev/sda and looks at sector
1 of the same hard drive for core.img. core.img is at this location and
looks in partition 6 for (,msdos6)/boot/grub.
sda1: __________________________________________________________________________
Boot Info Script 0.55 dated February 15th, 2010
============================= Boot Info Summary: ==============================
=> Grub 2 is installed in the MBR of /dev/sda and looks for Be.
sda1: _________________________________________________________________________
File system: ext4
Boot sector type: -