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 { EditorState, Modifier, SelectionState } from 'draft-js'; | |
/** | |
* Will remove the last block in the editor if it's empty. | |
* | |
* @param {EditorState} editorState | |
* @return {EditorState} | |
*/ | |
export default function trimContent(editorState) { | |
const content = editorState.getCurrentContent(); |
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> | |
<meta charset="utf-8"> | |
<title>Fearnleys Weekly PDF Test</title> | |
<script src="js/d3.js" charset="utf-8"></script> | |
<script src="js/c3.js"></script> | |
<link rel="stylesheet" href="css/c3.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> | |
<body onload="init()"> | |
<div id="chart"></div> |
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
var clipboardData = window.clipboardData || event.clipboardData || event.originalEvent && event.originalEvent.clipboardData; | |
var pastedText = clipboardData.getData("Text") || clipboardData.getData("text/plain"); | |
if (!pastedText && pastedText.length) { | |
return; | |
} | |
// Parse the pasted text from Excel into rows. | |
// Pasted text is usually separated by a new line for each row, |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) | |
type StopVisits struct { |
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
var results, passes, tests; | |
results = { | |
'switch': 0, | |
'keep': 0 | |
}; | |
passes = 100000; | |
tests = ['switch', 'keep']; | |
tests.forEach( function (test) { |
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
require "highline/import" | |
class HighLine | |
alias_method :orig_ask, :ask | |
def ask(question, answer_type = String, &details) | |
question = "<%= color('#{question}', :green) %>: " | |
orig_ask(question, answer_type = String, &details) | |
end |
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
var fs = require('fs'), | |
input = { | |
nifty: 91, | |
shaggus: 92, | |
svansemanden: 100, | |
plencis: 90, | |
turnunder: 75, | |
moui: 79, | |
mayoto: 85, | |
galacta: 77, |
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> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7 ]> <html lang="no" class="ie6"> <![endif]--> | |
<!--[if IE 7 ]> <html lang="no" class="ie7"> <![endif]--> | |
<!--[if IE 8 ]> <html lang="no" class="ie8"> <![endif]--> | |
<!--[if IE 9 ]> <html lang="no" class="ie9"> <![endif]--> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="no"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8" /> | |
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
// Create an inherhit / extend method | |
Function.prototype.inherits = function (class) { | |
$.extend(this.prototype, class.prototype); | |
} | |
var ExtendClass = function () { | |
// Call the "parent" constructor | |
Foobar.apply(this); | |
// Parent method |
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
<?$i=99;$b=" bottle";$o=" of beer";$v=" on the wall";while($i>0&&$y=$i)echo"$i$b",$y>1?"s":"","$o$v, $i$b",$y>1?"s":"","$o. | |
",$i>1?"Take one down and pass it around":"Go to the store and buy some more",", ",--$i?:"99",$b,$i>1||$i<1?"s":"","$o$v. | |
"; |
NewerOlder