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 sys | |
import socket | |
import select | |
import Queue | |
import threading | |
import time | |
class EchoServer(threading.Thread): | |
def __init__(self, host, port, message_queue, output_queue): | |
self.__message_queue = message_queue |
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 sys | |
import socket | |
import select | |
import Queue | |
import threading | |
import time | |
import vim | |
import os | |
class LogError(Exception): |
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
<?php | |
$input = file("php://stdin"); | |
sort($input); | |
file_put_contents(end($argv), join($input)); |
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
namespace :assets do | |
desc 'Run the precompile task locally and rsync with shared' | |
task :precompile, :roles => :web, :except => { :no_release => true } do | |
unless ENV['SKIP_ASSETS'] | |
if ENV['FORCE_ASSETS'] || releases.length <= 1 || capture("cd #{latest_release} && #{source.local.log(source.next_revision(current_revision))} vendor/assets/ app/assets/ | wc -l").to_i > 0 | |
system('bundle exec rake assets:precompile') | |
puts "syncing assets with shared directory..." | |
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}} | |
system('bundle exec rake assets:clean') | |
else |
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
--- | |
layout: none | |
--- | |
<?xml version="1.0" encoding="UTF-8"?> | |
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"> | |
<channel> | |
<title>{{ site.name | xml_escape }}</title> | |
<description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description> | |
<link>{{ site.url }}</link> | |
<language>en</language> |
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
set -g history-limit 5000 | |
set-window-option -g utf8 on # utf8 support | |
# Open man page in new window | |
bind / command-prompt "split-window 'exec man %%'" | |
bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard" | |
set -g update-environment -r | |
# quick view of processes | |
bind '~' split-window "exec htop" |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Manage unicorn server | |
# Description: Start, stop, restart unicorn server for a specific application. | |
### END INIT INFO |
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
class Instruction < ActiveRecord::Base | |
#... | |
def self.new_over_period(from, to, range, user) | |
where = "" | |
if user.is_solicitor | |
where = " AND instructions.solicitor_id IN ('"+user.solicitor.id.to_s+"')" | |
end |
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
class ApiConstraint | |
attr_reader :version | |
def initialize(options) | |
@version = options.fetch(:version) | |
end | |
def matches?(request) | |
request | |
.headers |
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
src/main.rs:8:36: 8:42 error: cannot borrow immutable local variable `buffer` as mutable | |
src/main.rs:8 try!(stdin.read_to_string(&mut buffer)); | |
^~~~~~ | |
<std macros>:1:1: 6:48 note: in expansion of try! | |
src/main.rs:8:5: 8:45 note: expansion site | |
error: aborting due to previous error |