Skip to content

Instantly share code, notes, and snippets.

View morgondag's full-sized avatar
😎
(◉-◉)

Kim Aarnseth morgondag

😎
(◉-◉)
View GitHub Profile
5013ca5c4ca81ef0ef06b6cb8e67b84c
Key alias: QG1vcmdvbmRhZy9nZXRnZWVr
Key password: 80766cfee31f0e620e0a9f52800bac85
@morgondag
morgondag / main.cpp
Created February 24, 2018 18:49
vulkan 101
#include <SDL2/SDL.h>
#include <SDL_vulkan.h>
#include <vulkan/vulkan.h>
#include <stdio.h>
#include <chrono>
#include <iostream>
#include <thread>
#include <vector>
@morgondag
morgondag / router.jsx
Created September 13, 2016 19:43
basic auth example
import React, { Component } from 'react'
import { render } from 'react-dom'
import { browserHistory, Router, Route, Link, withRouter } from 'react-router'
import { checkAuth } from './utils/auth.jsx'
import App from './components/app.jsx'
import Dashboard from './components/dashboard.jsx'
import Register from './components/register.jsx'
import Forgot from './components/forgot.jsx'
@morgondag
morgondag / gist:8540802
Created January 21, 2014 14:11
do we got old crappy flash?
var hasFlash = false;
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if(fo) hasFlash = true;
}catch(e){
if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) hasFlash = true;
}
@morgondag
morgondag / gist:8401700
Created January 13, 2014 14:54
سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ
سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Theme - Spacegray/base16-eighties.dark.tmTheme",
"detect_indentation": true,
"draw_minimap_border": true,
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"folder_exclude_patterns":
@morgondag
morgondag / gist:896c76f69888afc1236c
Created September 10, 2015 07:15
nw.js settings per platform
Windows:
"chromium-args": "--in-process-gpu --ignore-gpu-blacklist --enable-webgl --disable-transparency --disable-device-orientation"
Linux:
"chromium-args": "--ignore-gpu-blacklist --enable-webgl --disable-transparency --disable-device-orientation --disable-setuid-sandbox"
Mac OS X:
"chromium-args": "--ignore-gpu-blacklist --enable-webgl --disable-transparency --disable-device-orientation"
@morgondag
morgondag / gulpfile.js
Created September 1, 2015 14:11
render
var render = require('./app/render.js');
// Build our templates
gulp.task('templates', function() {
render.render(templateData.JS, templateData.CSS);
})
for (var i = 0; i < 6; i++) {
x = basepos.x + Math.sin( (Math.PI/12*i))*(600);
y = basepos.y + Math.cos( (Math.PI/12*i))*(600);
this.deployStar(x,y);
}
encode4HTML:function(str) {
return str
//.replace(/\r\n?/g,'\n')
// normalize newlines - I'm not sure how these
// are parsed in PC's. In Mac's they're \n's
//.replace(/(^((?!\n)\s)+|((?!\n)\s)+$)/gm,'')
// trim each line
//.replace(/(?!\n)\s+/g,' ')
// reduce multiple spaces to 2 (like in "a b")
//.replace(/^\n+|\n+$/g,'')