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> | |
// stub implementation in case the shell fragment fails to resolve | |
define("shell", function() { return stub; }); | |
</script> | |
</head> | |
<body> | |
<fragment src="shell.example.com"></fragment> |
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 ubuntu:xenial-20160525 | |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 575159689BEFB442 | |
RUN echo "deb http://download.fpcomplete.com/ubuntu xenial main"|tee /etc/apt/sources.list.d/fpco.list | |
RUN apt-get update | |
RUN apt-get install -y stack | |
RUN useradd -m -d /home/docker docker | |
USER docker |
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
export default function endlessContainer() { | |
'ngInject'; | |
return { | |
restrict: 'A', | |
scope: { | |
'endlessContainer': '&' | |
}, | |
link: function (scope, element, attrs) { | |
element.bind('scroll', function() { |
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
require "tco" | |
require "rmagick" | |
img = Magick::Image::read(ARGV[0]).first | |
img.each_pixel do |pixel, col, row| | |
c = [pixel.red, pixel.green, pixel.blue].map { |v| 256 * (v / 65535.0) } | |
pixel.opacity == 65535 ? print(" ") : print(" ".bg c) | |
puts if col >= img.columns - 1 | |
end |
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
# encoding: utf-8 | |
from __future__ import absolute_import, unicode_literals | |
import logging | |
from rest_framework import serializers | |
from rest_framework.exceptions import ValidationError | |
log = logging.getLogger(__name__) |
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 ast, _ast, copy | |
class Mutator(ast.NodeTransformer): | |
MUTATIONS = [ | |
# (FromOp, ToOp) | |
(_ast.Or, _ast.And), | |
(_ast.And, _ast.Or) | |
] | |
def mutate(self, root, mutation): |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<style> | |
#foo, #bar { background-color: rgba(1,1,1,.5); } | |
#foo { height: 100px; padding: 100px; } | |
#bar { height: 100px; } | |
</style> |
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
(let [ I-WISH (fn [x] (* x (mod (int \#) (int \!)))) | |
YOU-A (fn [x] (reduce + (map int x)))] | |
(I-WISH (YOU-A [\H \A \P \P \Y \N \E \W \Y \E \A \R \) \)]))) |
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
package lib.data | |
import play.api.db.slick.Config.driver.simple._ | |
// Inspired by: http://bit.ly/HL0y7u | |
private[data] trait DAO extends ReviewersComponent with ProposalsComponent with ValuationsComponent { | |
val Reviewers = new Reviewers | |
val Proposals = new Proposals | |
val Valuations = new Valuations | |
} |
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 kivy.app import App | |
from kivy.lang import Builder | |
from kivy.uix.widget import Widget | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.properties import ObjectProperty | |
Builder.load_string(''' | |
<MyContainer>: | |
MyWidget: |
NewerOlder