Skip to content

Instantly share code, notes, and snippets.

@pixelkritzel
pixelkritzel / mac-mischief.sh
Last active August 29, 2015 14:14
Mischief with an Apple computer
#Mischief with an Apple computer
say -v Hysterical muuaahahah
yes "Fuck you" | xargs say -v "Good News"
say -v Good oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
say -v Bad oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
<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>

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:

@pixelkritzel
pixelkritzel / backboneModelinAttributeObject.js
Created March 13, 2015 12:14
Backbone - expose model cid to attribute object
App.Model = Backbone.Model.extend({
initialize: function() {
this.set('cid', this.cid);
}
});
<!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 / new_gist_file.js
Created April 20, 2015 17:32
How to trim undefined
(this.get('foobar') || '').trim();
import React, { Component } from 'react';
import template from './MyComponentsTemplate';
export class MyComponent extends Component {
/* skipping all this */
render() {
retun template.call(this)
}
}
import React, { Component } from 'react';
export class MyComponent extends Component {
constructor(props) {
super(props);
this.state = {
foo: "foo",
bar: "bar"
}
}
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 {
import React, { Component } from 'react';
import template from './MyComponentsTemplate';
export class MyComponent extends Component {
/* skipping all this */
render() {
retun template.call(this)
}
}