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
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet | |
version="1.0" | |
xmlns:msxsl="urn:schemas-microsoft-com:xslt" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="html"/> | |
<xsl:template match="*"/> | |
<xsl:template match="svn"> | |
<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
class AssertionError < Exception | |
end | |
# If `cond` is `false`, raise `exc`. | |
# If `exc` is not provided, `AssertionError` will be raised instead with information about the faulty expression. | |
# If the expression is a comparison, the result of each side of the comparison will also be shown. | |
macro assert(cond, exc = nil) | |
unless {{ cond }} | |
{% if exc %} | |
raise {{ exc }} |
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
# Preserve HTTP/HTTPS protocol in .htaccess redirects | |
# http://stackoverflow.com/a/20419821/601064 | |
RewriteCond %{HTTPS} =on | |
RewriteRule ^(.*)$ - [env=proto:https] | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ - [env=proto:http] |
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
module MacroMagic | |
def initialize(**attributes) | |
{% for var in @type.instance_vars %} | |
if arg = attributes[:{{var.name.id}}]? | |
@{{var.name.id}} = arg | |
end | |
{% end %} | |
end | |
private def instance_var_get(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
#!/usr/bin/env bash | |
# make script exit if a simple command fails and | |
# make script print commands being executed | |
set -e -x | |
# names of latest versions of each package | |
export VERSION_PCRE=pcre-8.39 | |
export VERSION_OPENSSL=openssl-1.0.2f | |
export VERSION_NGINX=nginx-1.9.11 |
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
startup_message off | |
#defbce on | |
#deflog on | |
ignorecase on | |
vbell on | |
autodetach on | |
altscreen on # fix for residual editor text | |
defutf8 on | |
hardcopy_append on | |
compacthist on |
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
def retry(limit, *, backoff = nil) | |
attempts = 1 | |
loop do | |
return yield | |
rescue error | |
raise error if attempts == limit | |
sleep(backoff * attempts) if backoff | |
attempts += 1 | |
end | |
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
'use strict' | |
###* | |
# @ngdoc overview | |
# @name angularTypeform | |
# @description | |
# This module contains a directive that allows you easily embed a typeform | |
# in your angular 1.x app taking care about state changes | |
### | |
angular.module 'angularTypeform', [] |
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
// | |
// Benchmark.h | |
// Opskrifter | |
// | |
// Created by Sijawusz Pur Rahnama on 03/02/09. | |
// Copyleft 2009. Some rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
macro string_enum(name, &block) | |
enum {{name}} | |
{% for exp in block.body.expressions %} | |
{% if exp.is_a?(Assign) %} | |
{{exp.target}} | |
{% else %} | |
{{exp}} | |
{% end %} | |
{% end %} |