This file contains hidden or 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
# bash: | |
# # <(some_command) returns a file (technically a named pipe) for the result of some_command | |
# $ echo <(echo "hi") | |
# /dev/fd63 | |
# $ cat <(echo "hi") | |
# hi | |
# | |
# fish: | |
# # (some_command | psub) returns a file for the result of some_command | |
# $ echo (echo "hi" | psub) |
This file contains hidden or 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
#![feature(unboxed_closures)] | |
#![feature(fn_traits)] | |
use std::time; | |
use std::thread; | |
use std::sync::{Arc, RwLock}; | |
macro_rules! fn_clone { | |
// Normalized form | |
( |
This file contains hidden or 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 scala.reflect.ClassTag | |
object CartesianProduct { | |
/** | |
* Given an array containing a partial Cartesian product, and an array of | |
* items, return an array adding the list of items to the partial | |
* Cartesian product. | |
* | |
* {{{ | |
* val partialProduct = Array(Array(1, 4), Array(1, 5), Array(2, 4), Array(2, 5)) |
This file contains hidden or 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
/// Given a vector containing a partial Cartesian product, and a list of items, | |
/// return a vector adding the list of items to the partial Cartesian product. | |
/// | |
/// # Example | |
/// | |
/// ``` | |
/// let partial_product = vec![vec![1, 4], vec![1, 5], vec![2, 4], vec![2, 5]]; | |
/// let items = &[6, 7]; | |
/// let next_product = partial_cartesian(partial_product, items); | |
/// assert_eq!(next_product, vec![vec![1, 4, 6], |
This file contains hidden or 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
Copyright (c) 2015 Kyle Lacy | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
This file contains hidden or 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
; Based on https://gist.github.com/athos/1033052 | |
(ns cljl.java-interop | |
(:require [clojure.string :as str]) | |
(:import (clojure.asm Opcodes Type ClassWriter) | |
(clojure.asm.commons Method GeneratorAdapter))) | |
(def ^:dynamic *version* Opcodes/V1_6) | |
(def modifier->opcode |
This file contains hidden or 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
[$2ø\]d: | |
[[d;!>][d;!-@%\]#d;!=[%0\]?%]m: | |
0[1+$101\>][$15m;!0=$["FizzBuzz "]?~[$5m;!0=$["Buzz "]?~[$3m;!0=$["Fizz "]?~[$ . " "]?]?]?]# |
This file contains hidden or 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
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Graphics; | |
public class Block { | |
public BoundingBox Box; | |
public Color Color; | |
This file contains hidden or 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"?> | |
<PolicySet name="TwilightSparkle.mdpolicy"> | |
<TextStylePolicy inheritsSet="null" scope="text/x-csharp" /> | |
<CSharpFormattingPolicy inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp"> | |
<AlignEmbeddedUsingStatements>False</AlignEmbeddedUsingStatements> | |
<AlignEmbeddedIfStatements>False</AlignEmbeddedIfStatements> | |
<NamespaceBraceStyle>EndOfLine</NamespaceBraceStyle> | |
<ClassBraceStyle>EndOfLine</ClassBraceStyle> | |
<InterfaceBraceStyle>EndOfLine</InterfaceBraceStyle> | |
<StructBraceStyle>EndOfLine</StructBraceStyle> |
This file contains hidden or 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
# Based on https://github.com/simonair/homebrew-dupes | |
# That repo seems to be dead, and I don't really feel like making a pull request. | |
require 'formula' | |
class Ab < Formula | |
homepage 'http://httpd.apache.org/docs/trunk/programs/ab.html' | |
url 'http://www.apache.org/dist/httpd/httpd-2.4.3.tar.bz2' | |
sha1 '0ef1281bb758add937efe61c345287be2f27f662' | |
depends_on 'libtool' => :build |