Skip to content

Instantly share code, notes, and snippets.

Timo pixelkritzel

Block or report user

Report or block pixelkritzel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MyComponentsTemplate.jsx
import React from 'react';
var template = function(){return(
<form onSubmit={ this.handleFormSubmit.bind(this) } >
<input type="text" value={ this.foo } ref="foo" />
<button type="submit">Go!</button>
</form>
)}
View MyComponent_extern_template.js
import React, { Component } from 'react';
import template from './MyComponentsTemplate';
export class MyComponent extends Component {
/* skipping all this */
render() {
retun template.call(this)
}
}
View MyComponent_2.jsx
import React, { Component } from 'react';
var template = function template() { return(
<form onSubmit={ this.handleFormSubmit.bind(this) } >
<input type="text" value={ this.foo } ref="foo" />
<button type="submit">Go!</button>
</form>
)}
export class MyComponent extends Component {
View MyComponent_Original.jsx
import React, { Component } from 'react';
export class MyComponent extends Component {
constructor(props) {
super(props);
this.state = {
foo: "foo",
bar: "bar"
}
}
View MyComponent.js
import React, { Component } from 'react';
import template from './MyComponentsTemplate';
export class MyComponent extends Component {
/* skipping all this */
render() {
retun template.call(this)
}
}
@pixelkritzel
pixelkritzel / new_gist_file.js
Created Apr 20, 2015
How to trim undefined
View new_gist_file.js
(this.get('foobar') || '').trim();
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.fade-out {
opacity: 0;
@pixelkritzel
pixelkritzel / backboneModelinAttributeObject.js
Created Mar 13, 2015
Backbone - expose model cid to attribute object
View backboneModelinAttributeObject.js
App.Model = Backbone.Model.extend({
initialize: function() {
this.set('cid', this.cid);
}
});
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

View gist:00052754d325ed37e091
<a class="jsbin-embed" href="http://jsbin.com/hiliza/1/embed?html,js,output">JS Bin</a>
<script src="http://static.jsbin.com/js/embed.js"></script>
You can’t perform that action at this time.