Skip to content

Instantly share code, notes, and snippets.

export default function ifHelper([value]) {
if (value) {
this.yield();
}
}
@wycats
wycats / equivalence.js
Last active August 29, 2015 14:14
Proposal for Stage 0 of a contextual 'super()' operation in ES7
class Parent extends Person {
constructor() {
super(arg1, arg2);
// desugars to
// InitializeThis(<activefunction>.__proto__.[[Construct]]([arg1, arg2], NewTarget);
}
someMethod() {
// these are equivalent

A small sampling of external projects initially built for Ember use but designed to be used standalone:

/*global Spinner*/
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['dw-spin-view'],
size: 'large',
sizes: {
struct Person {
first: String,
last: String
}
fn main() {
let person = Person { first: "Alex".to_string(), last: "Matchneer".to_string() };
yehuda(&person);
}
use std::io::{Listener,Acceptor};
use std::io::net::unix::UnixListener;
pub fn main() {
let listener = UnixListener::bind(&Path::new("repro.sock")).unwrap();
let mut acceptor = listener.listen().unwrap();
acceptor.set_timeout(Some(1_000));
for _ in acceptor.incoming() {
@wycats
wycats / session.js
Last active June 21, 2019 22:32 — forked from anonymous/session.js
import Ember from 'ember';
export default Ember.Object.extend({
savedTransition: null,
init: function() {
this.set('isLoggedIn', localStorage.isLoggedIn);
},
loginUser: function() {
require "thor"
require "json"
require "pp"
require "asciiart"
class GithubCLI < Thor
desc "user [USER]", "show information for a particular user"
option "width", type: :numeric, aliases: "-w", default: 50,
banner: "The width of the ASCII art to show"
def user(name)
trait Matcher<T, U> {
fn matches(&self, actual: T) -> Result<U, ()>;
fn didnt_match(&self, actual: T, failure: U) -> MatchError;
fn did_match(&self, actual: T, failure: U) -> MatchError;
}
use std::default::Default;
use serialize::{Decoder, Decodable};
use util::canonical_field_name;
use {FlagConfig, FlagConfiguration};
#[deriving(PartialEq, Clone, Show)]
struct FieldUsage {
canonical: String,
alias: Option<char>,