This file contains 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
<script type="text/x-template" id="vue-file-agent-demo"> | |
<div> | |
<VueFileAgent | |
:uploadUrl="'https://www.mocky.io/v2/5d4fb20b3000005c111099e3'" | |
:uploadHeaders="{}" | |
:multiple="true" | |
:deletable="true" | |
:editable="true" | |
:meta="true" | |
:accept="'image/*,video/*,.pdf,.zip'" |
This file contains 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
fn prepare(line: &str) -> String { | |
if !line.is_empty() { | |
let mut line = line.chars(); | |
let prefix = line.next().unwrap(); | |
let output_line = line.collect::<String>(); | |
format!("{}{}", prefix, output_line) | |
} else { | |
"<empty line>".to_string() | |
} | |
} |
This file contains 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
#!/usr/bin/env python | |
from scipy.optimize import bisect | |
def record_optimization(func): | |
def recorder(self, *args, **kwargs): | |
if not hasattr(self, '_recorder_inputs'): | |
self._recorder_inputs = [] |
This file contains 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
#!/bin/bash | |
set -e | |
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
tar -xvzf libevent-2.0.21-stable.tar.gz | |
cd libevent-2.0.21-stable | |
./configure --prefix=/usr/local | |
make | |
sudo make install |
This file contains 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
width = 500 | |
height = 300 | |
cube = | |
nodes: [ | |
{x: 0, y: 0, z:0}, | |
{x: 0, y: 0, z:1}, | |
{x: 0, y: 1, z:0}, | |
{x: 0, y: 1, z:1}, | |
{x: 1, y: 0, z:0}, |
This file contains 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
class BaseChart | |
constructor: -> | |
@_width = 720 | |
@_height = 80 | |
draw: (selection) => | |
me = @ | |
selection.each( (d, i) -> me._draw(this, d, i) ) |
This file contains 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
# http://religions.pewforum.org/pdf/table-education-by-tradition.pdf | |
TOTAL = 35298.0 | |
Pr_postgrad = .11 | |
Pr_atheist = 509 / TOTAL | |
Pr_postgrad_given_atheist = .21 | |
Pr_postgrad_and_atheist = Pr_atheist * Pr_postgrad_given_atheist | |
Pr_postgrad_and_theist = (1 - Pr_atheist) * Pr_postgrad | |
Pr_atheist_given_postgrad = Pr_postgrad_and_atheist / (Pr_postgrad_and_atheist + Pr_postgrad_and_theist) |
This file contains 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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="page.js"></script> | |
<link rel="stylesheet" href="page.css" type="text/css"></link> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
$(function () { main() }); |
This file contains 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
#!/bin/sh | |
# git diff for regular diff usage | |
cmd=$(basename "$0") | |
[ "$1" = "--help" ] && { | |
echo "$cmd [git diff options] fileA fileB" | |
exit 0 | |
} | |
NewerOlder