Skip to content

Instantly share code, notes, and snippets.

Jack Franklin jackfranklin

Block or report user

Report or block jackfranklin

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 foo.jsx
const User = props => <p>This would render a user</p>
class Users extends React.Component {
// has this.state.users which is an array from an API
// not gonna bother writing the code to fetch that...
render() {
return (
<div>
<h2>The users</h2>
<ul>
View Web components.md

Confusing Components

Do I need all four parts?

  • Custom Elements
  • Shadow DOM
  • HTML Imports
  • HTML Templates

I'm confused as to which bits I need supported. Do I need all of them to blindy create and use other components?

View mutate.js
case 'TOGGLE_TODO':
const todos = state.todos.map((todo) => {
if (todo.id === action.id) {
todo.done = !todo.done;
}
return todo;
});
return { todos };
@jackfranklin
jackfranklin / omg.js
Created Oct 21, 2015
Deep destructuring and renaming in ES6
View omg.js
function foo({ text, user: { screen_name: screenName }}) {
console.log('text', text);
console.log('name', screenName);
}
foo({
text: 'hello world',
user: { screen_name: 'Jack' },
});
View keybase.md

Keybase proof

I hereby claim:

  • I am jackfranklin on github.
  • I am jackfranklin (https://keybase.io/jackfranklin) on keybase.
  • I have a public key whose fingerprint is 19A8 CC89 2230 3100 8B5F 7343 0FA7 7A5E 4B09 EA2B

To claim this, I am signing this object:

View gist:d68da70ed43203c2eb4a
var Q = require('Q');
var fs = require('fs');
var generator = Q.async(function* () {
yield 10
console.log('yielded 10');
yield 20
console.log('yielded 20');
yield 30
View gist:b774a3c976b126356972
def double(x)
x * 2
end
p [1,2,3].map(&method(:double))
# [2, 4, 6]
View hodor.rb
class Hodor
def method_missing(sym)
'Hodor'
end
end
puts Hodor.new.hello
puts Hodor.new.blahblah
View gist:10629549
Team Bibs
- Jack
- Grant "The Rock" Heywood
- Kyam
- Matt P
- Dave "Stepovers" Kelly
- Dan "Stripper" Dineen
- Darren
Team STINKYFACES
@jackfranklin
jackfranklin / gist:10560583
Created Apr 12, 2014
ES6 Arrow Functions FTW.
View gist:10560583
module.exports = function(app) {
var lookup = {
'NOT_STARTED': 'not started',
'STARTED': 'started',
'BLOCKED': 'blocked'
};
app.filter('prettyState', () => (input) => lookup[input]);
app.filter('prettyState', function() {
return function(input) {
You can’t perform that action at this time.