This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"author":"Barry Smith","text":"Test"},{"author":"James Brown","text":"ASDFG!"}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"author":"Barry Smith","text":"Test"},{"author":"James Brown","text":"ASDFG!"}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<div id="main" /> | |
<script src=http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js></script> | |
<script src=http://cdnjs.cloudflare.com/ajax/libs/react/0.10.0/JSXTransformer.js></script> | |
<script src=http://cdnjs.cloudflare.com/ajax/libs/react/0.10.0/react-with-addons.min.js></script> | |
<script type="text/jsx"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Download the React DevTools for a better development experience: http://fb.me/react-devtools react.js:4356 | |
DOM fully loaded and parsed uitest.html:40 | |
You are using the in-browser JSX transformer. Be sure to precompile your JSX for production - http://facebook.github.io/react/docs/tooling-integration.html#jsx JSXTransformer.js:12703 | |
_ | |
function (obj) { | |
if (obj instanceof _) return obj; | |
if (!(this instanceof _)) return new _(obj); | |
this._wrapped = obj; | |
} underscore.js:36 | |
mori |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
module.exports = { | |
constantify: function constantify(app, obj, prevK) { | |
for (var k in obj) { | |
var nextK = prevK ? prevK + '.' + k : app + '.' + k; | |
if (obj[k] === null) obj[k] = nextK; | |
else constantify(app, obj[k], nextK); | |
} | |
return obj; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Z { | |
potato: string | |
} | |
abstract class A<T> { // I want to indicate that T will always at least implement Z | |
protected foo(bar: T) { | |
console.log(bar.potato); // ERROR: [ts] Property 'potato' does not exist on type 'T' | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as moment from 'moment' | |
for (let i = 0; i < 12; i++) { | |
const start = moment('2018-02-28') | |
console.log(start.add(i * 30, 'd').format('DD MMMM YYYY')) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- message: test psot 8 | |
id: '220955331788460_220956781788315' | |
comments: | |
data: | |
- message: test comment | |
id: '220958945121432' | |
paging: | |
cursors: | |
before: >- | |
WTI5dGJXVnVkRjlqZAFhKemIzSTZANakl3T1RVNE9UUTFNVEl4TkRNeU9qRTFNakl5TlRReE1qVT0ZD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Sets Prezto options. | |
# | |
# Authors: | |
# Sorin Ionescu <[email protected]> | |
# | |
# | |
# General | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myArray = [{:key => nil, :x => nil}, {:z => nil}, {:potato => "hi", :deep => {:deep => {:deep => "asf" } } } ] | |
print myArray | |
print "\n" | |
potato = "hi" | |
# IMMUTABLE VERSION: make a new array but with hashes that are either the same exact hash or an updated version | |
myArray2 = myArray.map do |hash| | |
hash.key?(:key) ? hash.merge({:key => potato}) : hash | |
end |