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 MyClass: | |
def __init__(self, high_order, applied): | |
self.high_order_func = high_order | |
self.applied_func = applied | |
def call(self, values): | |
return self.high_order_func(self.applied_func, values) | |
def 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
defmodule Foobar.Mixfile do | |
use Mix.Project | |
def project do | |
[app: :opencov, | |
version: "0.0.1", | |
elixir: "~> 1.0", | |
elixirc_paths: elixirc_paths(Mix.env), | |
compilers: [:phoenix] ++ Mix.compilers, | |
build_embedded: Mix.env == :prod, |
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
.dropdown > ul > li > a:focus { | |
background-color: #46629E; | |
} |
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 makeNumber(n) { | |
var one = '①'; | |
var encoded = encodeURIComponent(one); | |
var modified = encoded.substring(0, encoded.length - 1) + (n - 1).toString(); | |
return decodeURIComponent(modified); | |
} |
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
defmodule Waterfall do | |
def conditional_chain(value, []), do: value | |
def conditional_chain(value, [{condition, fun}|rest]) when is_function(fun) do | |
value = if condition, | |
do: apply_fun(fun, value, condition), | |
else: value | |
conditional_chain(value, rest) | |
end | |
defp apply_fun(fun, value, condition) when is_function(fun) 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
defmodule Opencov.CreateBuildService do | |
def make_changeset(project, params \\ :empty) do | |
Ecto.Model.build(project, :builds) | |
|> Opencov.Build.changeset(params) | |
|> add_previous_values(project) | |
end | |
defp add_previous_values(changeset, project) do | |
if previous_build = search_previous_build(changeset, project) do | |
change(changeset, %{previous_build_id: previous_build.id, previous_coverage: previous_build.coverage}) |
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 __fundle_next_arg -a index | |
set -l args $argv[2..-1] | |
set -l arg_index (math $index + 1) | |
if test (count $args) -lt $arg_index | |
echo "missing argument for $args[$index]" | |
return 1 | |
end | |
set -l arg $args[$arg_index] | |
switch $arg | |
case '--*' |
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
# for releases available at s3.hex.pm/builds/elixir | |
# using language: elixir is simpler | |
language: erlang | |
otp_release: | |
- 18.1 | |
before_install: | |
- curl -sSL https://raw.githubusercontent.com/taylor/kiex/master/install | bash -s | |
before_script: | |
- kiex install $ELIXIR_VERSION |
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
curl -X POST --data-urlencode 'payload={"channel": "#alerts", "username": "Login alerter", "text": "A user conneed to '"$(hostname -f)"'", "attachments": [{"text": "'"$(w)"'"}]}' https://hooks.slack.com/services/SLACK/WEBHOOK/TOKEN >> /var/slack.log 2>&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
'use strict'; | |
var gulp = require('gulp'); | |
var jade = require('gulp-jade'); | |
var watch = require('gulp-watch'); | |
var stylus = require('gulp-stylus'); | |
var connect = require('gulp-connect'); | |
gulp.task('jade', function () { | |
var src = 'app/templates/**/*.jade'; |