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 argparse | |
import sys | |
import koji | |
import yaml | |
parser = argparse.ArgumentParser() | |
parser.add_argument("TAG") | |
parser.add_argument("--koji-profile", default="brew") | |
parser.add_argument("--arch", action="append") |
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 click | |
import requests | |
def parse_rates(data): | |
header, names, *lines = data.splitlines() | |
rates = {} | |
for line in lines: | |
_, _, amount, currency, value = line.replace(",", ".").split("|") | |
rates[currency] = float(value) / float(amount) |
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
diff --git a/pdc/apps/common/hacks.py b/pdc/apps/common/hacks.py | |
index ca55552..c9ce891 100644 | |
--- a/pdc/apps/common/hacks.py | |
+++ b/pdc/apps/common/hacks.py | |
@@ -5,6 +5,7 @@ | |
# http://opensource.org/licenses/MIT | |
# | |
import re | |
+import contextlib | |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>Token example</title> | |
</head> | |
<body> | |
<div id="token">Loading token...</div> | |
<script> | |
document.addEventListener("DOMContentLoaded", 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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import pdc_client | |
# This will automatically obtain token from server identified by "prod" in | |
# configuration file. | |
client = pdc_client.PDCClient('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
import qualified Database.Persist as P | |
main :: IO () | |
main = do | |
conf <- Yesod.Default.Config.loadConfig $ (configSettings Testing) | |
{ csParseExtra = parseExtra | |
} | |
dbconf <- withYamlEnvironment "config/postgresql.yml" (appEnv conf) | |
P.loadConfig >>= | |
P.applyEnv |
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 Iris where | |
import Data.Vector (Vector) | |
import Control.Arrow | |
import qualified Data.Vector as V | |
import Data.Complex | |
learning :: Vector (Vector (Complex Double), Int) | |
learning = V.fromList $ map (first $ V.fromList . map cis) | |
[ ([0.31, 0.873, 0.095, 0.058], 0) |
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
data Alert = MSuccess | MWarning | MInfo | |
deriving (Eq, Enum, Bounded, Show) | |
mkToCls :: Alert -> Text | |
mkToCls MSuccess = "alert-success" | |
mkToCls MWarning = "alert-warning" | |
mkToCls MInfo = "alert-info" | |
class (Enum a, Bounded a, Show a) => MessageKey a |
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
#define _POSIX_SOURCE | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <signal.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define CMDLINE "NEJAKY_PRIKAZ" |
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 Graph_t where | |
import Graph | |
import Test.HUnit | |
import Control.Exception | |
import Control.Monad | |
--t_ = TestCase $ assertEqual "" (show ( )) "" |