Skip to content

Instantly share code, notes, and snippets.

View kennethlarsen's full-sized avatar

Kenneth Larsen kennethlarsen

View GitHub Profile
@kennethlarsen
kennethlarsen / windowSize.cs
Created September 4, 2012 11:18
Define windows size, XNA c#
protected override void Initialize()
{
// TODO: Add your initialization logic here
graphics.PreferredBackBufferHeight = 500;
graphics.PreferredBackBufferWidth = 500;
graphics.IsFullScreen = false;
graphics.ApplyChanges();
Window.Title = "Title here";
base.Initialize();
}
@kennethlarsen
kennethlarsen / rss from form input.php
Created January 21, 2013 08:48
Get RSS from form input
<?php // Load and parse the XML document
$rss = simplexml_load_file($_POST['xmlurl']);
$title = $rss->channel->title;
?>
<html xml:lang="da" lang="da">
<head>
<meta charset="UTF-8">
<title><?php echo $title; ?></title>
</head>
@kennethlarsen
kennethlarsen / gist:79b449ced043c16b3eac
Created March 20, 2016 16:59
Creating new ember project with bootstrap
ember install ember-cli-sass && ember install ember-cli-bootstrap-sassy && echo '@import "bootstrap";' > ./app/styles/app.scss && rm ./app/styles/app.css

Keybase proof

I hereby claim:

  • I am kennethlarsen on github.
  • I am kennethlarsen (https://keybase.io/kennethlarsen) on keybase.
  • I have a public key ASD-KVBt-mIGmvaLCndgzVA0dADlFTt2aDidnBq3wacp1Qo

To claim this, I am signing this object:

@kennethlarsen
kennethlarsen / controllers.application.js
Created October 28, 2016 12:40
ember-simple-typeahead
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@kennethlarsen
kennethlarsen / controllers.application.js
Created October 28, 2016 12:40
ember-simple-typeahead
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
import myTemplate from '../templates/suggestion-template'
import footerTemplate from '../templates/footer-template'
export default Ember.Controller.extend({
suggestionTemplate: myTemplate,
footerTemplate: footerTemplate,
actions: {
doSomething: function() {
this.set('clicked', true);
@kennethlarsen
kennethlarsen / fb-login.html
Created April 21, 2017 13:54
This was used alongside with leaked APP_ID from information.dk to create login outside of their control
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<title>Facebook login</title>
<script>
$(document).ready(function() {
$.ajaxSetup({ cache: true });
$.getScript('//connect.facebook.net/en_US/sdk.js', function(){
FB.init({
appId: 'APP_ID',
@kennethlarsen
kennethlarsen / headings.html
Created July 1, 2017 13:46
Accessibility: Headings
<!-- Bad headings -->
<h1>Cool company name</h1>
<h3>Buy stuff</h3>
<h3>Jobs</h3>
<h2>Get our app</h2>
<!-- Great headings -->
<h1>Cool company name</h1>
<h2>Buy stuff</h2>
<h2>Jobs</h2>
<!-- Accesible button as a div -->
<div tabindex="0"
role="button"
id="action">
Buy stuff
</div>
<!-- Accesible toggle button as an <a>-element -->
<a tabindex="0"
role="button"