Skip to content

Instantly share code, notes, and snippets.

@bernos
bernos / Makefile.golang
Last active April 30, 2018 01:47 — forked from dnishimura/Makefile.golang
Makefile for Golang projects
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code
@bernos
bernos / template.sh
Created January 5, 2017 23:01
Standard bash template
#!/usr/bin/env bash
usage() {
cat <<EOF
NAME:
$(basename $0)
DESCRIPTION:
TODO: describe me
SYNOPSIS:
@bernos
bernos / new_gist_file
Created September 10, 2014 06:25
Nancyfx Json Serializer configuration
using Nancy;
using Nancy.Bootstrapper;
using Nancy.Serialization.JsonNet;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace Templify.NancyAspNetRazor.Web.Config
{
@bernos
bernos / ProgramOwinHost.cs
Created May 22, 2014 11:36
Vagrant - Ubuntu precise 32 with mono 3.28 and nancy hosting examples
/**
* Uses Owin HttpListener to host the app. To get this working you'll need to
* install the following nuget packages
*
* install-package Microsoft.Owin.Hosting
* install-package Microsoft.Owin.Host.HttpListener
* install-package Nancy.Owin
*/
using Microsoft.Owin.Hosting;
using Owin;
@bernos
bernos / css_resources.md
Created March 16, 2014 01:31 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@bernos
bernos / javascript_resources.md
Created March 16, 2014 01:31 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@bernos
bernos / 0_reuse_code.js
Created March 16, 2014 01:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bernos
bernos / build.proj
Last active August 29, 2015 13:56
MSBuild Templify AfterBuild target example
<!-- Once built, templates belong in %HOMEDIR%\AppData\Roaming\endjin\Templify\repo -->
<Target Name="AfterBuild">
<Message Text="---------------"/>
<Message Text="TEMPLIFY"/>
<Message Text="---------------"/>
<PropertyGroup>
<TemplifyMode>c</TemplifyMode>
<TemplifyPath>"$(MSBuildProjectDirectory)\..\..\TemplifyMsBuildExample"</TemplifyPath>
<TemplifyPackageName>"Templify MS Build Example"</TemplifyPackageName>
@bernos
bernos / MigrationsConfiguration.cs
Created December 12, 2013 07:27
MySql with entity framework 5.x
using MySql.Data.Entity;
namespace MyProject.Migrations
{
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
internal sealed class Configuration : DbMigrationsConfiguration<MySqlEntityFrameworkTest.ChinookContext>
@bernos
bernos / ExampleController.cs
Created October 21, 2013 08:35
ASP.net MVC4 paginated lists
public virtual ActionResult Index(int page = 1, int pageSize = 10)
{
var work = UnitOfWork();
int total;
if (pageSize > MaxPageSize)
{
pageSize = MaxPageSize;
}