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 guard(*exprs, &block) | |
{% if exprs.size == 1 %} | |
({{ exprs.first }}).tap do |v| | |
{{ yield }} unless v | |
end | |
{% else %} | |
{ | |
{% for expr in exprs %} | |
({{ expr }}), | |
{% 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
require "colorize" | |
require "log" | |
require "yaml" | |
# --- | |
target_version = "~> 1.5.0" | |
root_dir = "~/Code" | |
paths = %w[ |
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
defprotocol Presence do | |
@doc "Determines whether the value is present and truthy" | |
def present?(data) | |
end | |
defimpl Presence, for: Atom do | |
def present?(false), do: false | |
def present?(nil), do: false | |
def present?(_), do: true | |
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
<?php | |
class EventServiceProvider extends ServiceProvider | |
{ | |
/** | |
* The subscriber classes to register. | |
* | |
* @var array | |
*/ | |
protected $subscribe = [ |
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 %} |
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
struct Synchronized(T) | |
protected getter __wrapped__ : T | |
def initialize(wrapped : T = T.new, protection : Mutex::Protection = :reentrant) forall T | |
@__wrapped__ = wrapped | |
@__lock__ = Mutex.new(protection) | |
end | |
macro method_missing(call) | |
@__lock__.synchronize do |
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
# This code is licensed from CircleCI to the user under the MIT license. See | |
# https://circleci.com/orbs/registry/licensing for details. | |
version: 2.1 | |
description: Run commands with retry | |
commands: | |
run-with-retry: | |
description: Run command with retry | |
parameters: |
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
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
#!/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 |
NewerOlder