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 sh | |
# A wrapper around the Nim compiler to allow for easy scripting of Nim. Puts | |
# all temporary files in a temporary directory and cleans up after itself. | |
# | |
# Usage: | |
# - add `#!/usr/bin/env nimrun` at the beginning of your script | |
# - execute the nim file with it, for example, `nimrun file.nim args` | |
# | |
# Possible future extentions: |
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
type | |
yaml_version_directive_t* = object | |
major*: cint | |
minor*: cint | |
type | |
yaml_tag_directive_t* = object | |
handle*: cstring | |
prefix*: cstring | |
type | |
yaml_encoding_t* {.size: sizeof(cint).} = enum |
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
language: C | |
compiler: | |
- gcc | |
before_install: | |
# Install nim | |
- git clone -b master git://github.com/Araq/Nim.git --depth 1 | |
- cd Nim | |
- git clone -b master --depth 1 git://github.com/nim-lang/csources | |
- cd csources && sh build.sh | |
- cd .. |
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
BASH_FILE=~/.zshrc | |
mkdir -p ~/.python/src | |
cd !$ | |
wget https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tgz --no-check-certificate | |
tar xfz Python-3.4.2.tgz | |
cd Python-3.4.2 | |
mkdir $HOME/.python/python3.4 | |
./configure --prefix=!$ && make && make install | |
cd ~ |
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
----------------------------------------- | |
-- Show and Hide <application> | |
----------------------------------------- | |
-- | |
-- This script allows you to easily | |
-- toggle the visibility of a specific | |
-- app, similar to how Twitter and | |
-- Sparrow toggle with their global | |
-- hotkey option. | |
-- |
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 = [{"Brian", 42}, {"Alan", 30}, {"Brian", 32}] | |
# unstable | |
data.sort_by &.[0] # => [{"Brian", 42}, {"Alan", 30}, {"Brian", 32}] | |
# stable | |
data.map_with_index { |d,i| {d,i} }.sort_by { |di| {di[0][0], di[1]} }.map { |di| di[0] } # => [{"Alan", 30}, {"Brian", 42}, {"Brian", 32}] |
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
#!/bin/bash | |
### | |
### my-script — does one thing well | |
### | |
### Usage: | |
### my-script <input> <output> | |
### | |
### Options: | |
### <input> Input file to read. | |
### <output> Output file to write. Use '-' for stdout. |
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
# URI of the local (caching) HTTP proxy | |
LOCAL_HTTP_PROXY = 'http://192.168.33.200:8123' | |
# Configures vagrant-cachier and vagrant-proxyconf. | |
# Should be called only on "local machine" providers. | |
def configure_caching(config) | |
if Vagrant.has_plugin?('vagrant-cachier') | |
config.cache.enable_nfs = true | |
config.cache.enable :gem | |
config.cache.enable :npm |
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 "option_parser" | |
require "http/server" | |
require "json" | |
class Settings | |
property port = 3000 | |
property host = "127.0.0.1" | |
property? show_headers = false | |
property? show_raw_json = false | |
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
{ | |
viewer { | |
repositories(privacy: PUBLIC, first: 3, orderBy: {field: PUSHED_AT, direction: DESC}) { | |
nodes { | |
nameWithOwner | |
url | |
} | |
} | |
} | |
} |
OlderNewer