Skip to content

Instantly share code, notes, and snippets.

@Phate6660
Phate6660 / rust recommendations and alternatives.md
Last active September 1, 2023 16:49
My growing list of Rust programs to use.

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@geelen
geelen / 1_Readme.md
Last active August 29, 2015 14:21
Traits

Global traits, local components

The idea is to combine the best bit of global styling (reuse, small payload) and local styling (total isolation, first-class React syntax)

This is combined with the concept of traits: you can think of them as permitted property/value pairs. Instead of every component being able to have every CSS property available to it, you can reduce your permitted set to X font families, Y font-size + line-height pairs, Z foreground/background colour pairs, W padding amounts. This is based off my work using amcss on real projects — traits were the single key feature that kept me using AM.

The one-sentence explanation: A site defines a set of permitted visual features, all components are simply a combination of those features

Definitions

#!/bin/tcsh
# Grab user information.
echo "PrivateInternetAccess OpenVPN Setup:"
echo " https://www.privateinternetaccess.com/pages/client-control-panel"
echo " -> PPTP/L2TP/SOCKS Username and Password"
echo -n "User: "
set user = $<
echo -n "Pass: "
set pass = $<
@eldh
eldh / icon.coffee
Created November 8, 2014 15:34
React Icon component
React = require 'react/addons'
module.exports = React.createClass
displayName: 'Icon'
propTypes:
className: React.PropTypes.string
icon: React.PropTypes.string.isRequired
render: ->
React.createElement 'span',
dangerouslySetInnerHTML:
@ivanvanderbyl
ivanvanderbyl / account_routes.js
Last active January 31, 2016 17:55
Using Ember initializers and injections to setup the `currentUser` within your app.
App.AccountEditRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('content', this.get('currentUser'));
}
});
@tomdale
tomdale / gist:4263171
Created December 11, 2012 23:05
Ember Data Read-Only API Proposal

Read-Only

An important feature for Ember Data is providing helpful error messages when your application tries to do something that is forbidden by the data model.

To that end, we would like for the data model to be able to mark certain records, attributes, and relationships as read-only. This ensures that we can provide errors immediately, and not have to wait for a return trip from the adapter.

This also means that the adapter does not need to handle the case where an application developer inadvertently makes changes to a record that it does not conceptually make sense to modify on the client.

Requirements

@callumj
callumj / README.md
Created November 18, 2012 10:30
Use rtmpdump and ffmpeg to download BBC Radio 1 shows

This script will use the tools rtmpdump and ffmpeg to download and convert a BBC Radio 1 show into a m4a file.

It is capable of either downloading a show direct, or finding the latest show from a webpage.

Requirements

  • nokogiri (Ruby gem)
  • rtmpdump (binary)
  • ffmpeg (binary)
@getify
getify / 1.js
Created November 13, 2012 00:19
illustrating some potential issues with adding `let` to code which already has `var` used in it...
// var: poor stylistic form, but no leakage
function foo() {
bar = 3;
if (true) {
var bar = 5;
}
}
// let: will leak an auto-global
function foo() {

It All Starts With Templates

An Ember application starts with its main template. Put your header, footer, and any other decorative content in application.handlebars.

<header>
  <img src="masthead">
</header>

<footer>