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
FROM phusion/passenger-full:latest | |
# Set correct environment variables. | |
ENV HOME /root | |
# Use baseimage-docker's init process. | |
CMD ["/sbin/my_init"] | |
# Build system and git. | |
RUN /build/utilities.sh |
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
import sys, time | |
stdout = sys.stdout | |
BAILOUT = 16 | |
MAX_ITERATIONS = 1000000 | |
class Iterator: | |
def __init__(self): | |
print('Rendering...') | |
for y in range(-39, 39): |
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
import time | |
class Person: | |
def __init__(self, count): | |
self.count = count | |
self.prev = None | |
self.next = None | |
def shout(self, shout, deadif): | |
if shout < deadif: | |
return shout + 1 |
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
import unittest | |
import datetime | |
def last_week_days(day, week_day, n): | |
''' | |
Last n days of the week | |
:param day: datetime.date | |
:param week_day: int (0=Monday, 1=Tuesday, ... 6=Sunday) | |
:param n: number of past weeks |
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
window.f1 = function () { | |
var p1 = Q.defer(); | |
if { | |
p1.resolve({'resolved f1:': x}) | |
} else { | |
p1.reject({'rejected f1': x}) | |
} | |
return p1.promise; | |
}; |
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
$(function () { | |
$('#container').highcharts({ | |
chart: { | |
zoomType: 'xy' | |
}, | |
colors: ['#7cb5ec', '#91e8e1', '#90ed7d', '#f7a35c', '#8085e9', | |
'#f15c80', '#e4d354', '#8085e8', '#8d4653', '#91e8e1'], | |
title: { | |
text: 'Something ' |
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
#given: argv = {'--encoding': 'utf-8', '--orientation': 'Landscape', '-s': 'A4'} | |
#expected: ['--orientation', 'Landscape', '-s', 'A4', '--encoding', 'utf-8'] | |
#Python: | |
import itertools | |
print(list(itertools.chain.from_iterable(list(argv.items())))) | |
# Ruby: |
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
import React from 'react'; | |
class Navbar extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = {isChecked: true, radio: 1}; | |
} | |
handleCheckbox() { | |
this.setState({isChecked: !this.state.isChecked}); |
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
import subprocess | |
html = subprocess(['babel-node', 'main.js']) | |
print html |
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
import React, { Component, PropTypes } from 'react' | |
import { Table, Column } from 'fixed-data-table' | |
import _ from 'lodash' | |
const SortTypes = { | |
ASC: 'ASC', | |
DESC: 'DESC' | |
}; | |
class DataTable extends Component { |