Skip to content

Instantly share code, notes, and snippets.

View MeirionHughes's full-sized avatar
💤
I may be slow to respond.

Meirion Hughes MeirionHughes

💤
I may be slow to respond.
  • Wales
View GitHub Profile
@jfsiii
jfsiii / index.html
Last active January 4, 2021 18:11
Full-Screen Layout using Flexbox
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Holy Grail</title>
<style>
/* some basic styles. nothing to do with flexbox */
header, footer,
nav, article, aside {
border: 1px solid black;
@SunboX
SunboX / inlineworker.js
Created June 24, 2013 12:21
Create web workers without a separate worker JS files. Source: http://jsbin.com/owogib/8/
function worker() {
setInterval(function() {
postMessage({foo: "bar"});
}, 1000);
}
var code = worker.toString();
code = code.substring(code.indexOf("{")+1, code.lastIndexOf("}"));
var blob = new Blob([code], {type: "application/javascript"});
@justincarroll
justincarroll / bootstrap-masonry-template.htm
Last active August 15, 2020 16:48
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@fkautz
fkautz / serverdemo.go
Created January 31, 2014 07:33
A simple demo of mixing various go http server and rpc using mux
package main
import (
"bytes"
"fmt"
"github.com/gorilla/mux"
grpc "github.com/gorilla/rpc"
"github.com/gorilla/rpc/json"
"log"
"net/http"
@grofit
grofit / Account.cs
Created January 7, 2015 11:45
A GOOD Generic Repository Pattern
public class Account
{
Guid Id {get;set;}
string Name {get;set;}
}
@hackwaly
hackwaly / red_black_tree.ts
Created March 10, 2015 15:26
Red black tree implemented in typescript
enum Color {
RED,
BLACK
}
class Node {
public parent: Node;
public left: Node;
public right: Node;
@dsherret
dsherret / Using.ts
Last active October 26, 2023 13:30
Typescript Disposable (using statement)
// NOTE: This is now rolled up in a package and supports more scenarios: https://github.com/dsherret/using-statement
interface IDisposable {
dispose();
}
function using<T extends IDisposable>(resource: T, func: (resource: T) => void) {
try {
func(resource);
} finally {
anonymous
anonymous / alt-layout.html
Created May 12, 2016 13:29
Aurelia router with layouts
<template>
<section class="au-animate">
<div class="well">
<content select="#navigation"></content>
</div>
<div>
<content select="#content"></content>
</div>
</section>
</template>
@atsu85
atsu85 / aurelia-template-lint.js
Last active September 15, 2016 15:02
gulp task `lint-templates` to lint Aurelia templates (also shows UI notification when there is a problem or when all problems are fixed)
var gulp = require('gulp');
var linter = require('gulp-aurelia-template-lint');
var config = new (require('aurelia-template-lint').Config);
var fail = require('gulp-fail');
var gulpIf = require('gulp-if');
var gutil = require('gulp-util');
var notify = require("gulp-notify");
var paths = require('../paths');
@niieani
niieani / server-renderer.js
Last active January 11, 2017 00:55
Server Rendering Aurelia
import * as path from 'path';
import 'aurelia-polyfills';
import {Options, NodeJsLoader} from 'aurelia-loader-nodejs';
import {PLATFORM, DOM} from 'aurelia-pal';
import {globalize} from 'aurelia-pal-nodejs';
import {Aurelia} from 'aurelia-framework';
// ignore importing '.css' files, useful only for Webpack codebases that do stuff like require('./file.css'):
require.extensions['.css'] = function (m, filename) {
return;