Skip to content

Instantly share code, notes, and snippets.

@jlebrech
jlebrech / webpack.config.js
Created June 7, 2018 13:18
webpack 3.1, AngularJS 1.x config
var path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
config = {
entry: {
app: './app/scripts/main.js',
login: './app/scripts/login.js',
vendors: './app/scripts/vendors.js'
@jlebrech
jlebrech / ng-options.html
Created October 19, 2015 14:08
angular is dumb
<select
ng-model="selected.service_plan"
ng-options="item.id as ('£' + item.label) for item in billing_info.service_plans">
</select>
what's wrong with looping through stuff rather than come up with some expression language? speed?
@jlebrech
jlebrech / a.stache
Created October 14, 2014 16:44
Can bootstrap
<ui-panel>
<div class="panel-heading">
Title here
</div>
<div class="panel-body" style="height:200px">
....
</div>
<div class="panel-footer clearfix">
Footer
</div>
results = []
for (i in res.guests){
model = {
name: res.guests[i].name
};
Object.defineProperties(model, {
'reversename': {
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
#core_scaffold {
position: absolute;
top: 0px;
right: 0px;
@jlebrech
jlebrech / components.xml
Created June 3, 2014 16:14
Just a mashup of a site layout using simple semantics
<main>
<nav>
<link to="">somewhere</link>
link to="">somewhere</link>
link to="">somewhere</link>
</nav>
<section type="blog">
<post author="" date="">
Lorem ipsum
</post>
@jlebrech
jlebrech / edit.html.erb
Last active August 29, 2015 13:56
RealForm
<% @my_form.render do |f| # custom form %>
<div class="firstname"><%= f.firstname # maybe options are possible here %></div>
<div class="text"><%= f.text %></div>
<% end %>
<%= @my_form.render # no customization %>
require 'ostruct'
class MyForm < OpenStruct
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
validates :name, :presence => true
def initialize(*args)
super
➜ go-gtk git:(master) make
cd pango && go build && go install github.com/mattn/go-gtk/pango
package .
imports runtime: cannot find package "runtime" in any of:
/usr/local/go/bin/src/pkg/runtime (from $GOROOT)
/Users/jlebrech/gocode/src/runtime (from $GOPATH)
package .
imports runtime/cgo: cannot find package "runtime/cgo" in any of:
/usr/local/go/bin/src/pkg/runtime/cgo (from $GOROOT)
/Users/jlebrech/gocode/src/runtime/cgo (from $GOPATH)
~ go get github.com/mattn/go-gtk/gtk
package github.com/mattn/go-gtk/gtk
imports fmt: unrecognized import path "fmt"
package github.com/mattn/go-gtk/gtk
imports runtime: unrecognized import path "runtime"
package github.com/mattn/go-gtk/gtk
imports runtime/cgo: unrecognized import path "runtime/cgo"
package github.com/mattn/go-gtk/gtk
imports unsafe: unrecognized import path "unsafe"
package github.com/mattn/go-gtk/gtk