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
#Download Elementary OS from here: | |
#http://sourceforge.net/projects/elementaryos/files/stable/ | |
#First you update your system | |
sudo apt-get update && sudo apt-get dist-upgrade | |
#Install Google Chrome | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' |
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 XCPlayground | |
import Foundation | |
import UIKit | |
class Channel<T> | |
{ | |
var stream: Array<T> | |
let queue: dispatch_queue_t | |
let semaphore: dispatch_semaphore_t | |
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
/** The returned generator will enumerate each value of the provided tuple. */ | |
func generatorForTuple(tuple: Any) -> AnyGenerator<Any> { | |
return anyGenerator(Mirror(reflecting: tuple).children.lazy.map { $0.value }.generate()) | |
} | |
// Blogged at http://design.featherless.software/enumerating-tuple-values-swift/ |
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
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev libffi-dev libjemalloc-dev | |
apt-get -y install autoconf curl bzip2 | |
apt-get -y autoremove | |
apt-get -y clean | |
cd /usr/local/src | |
curl http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz |
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
defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID |
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 | |
# commit without hook: | |
# git commit --no-verify | |
# | |
declare -i REJECTED | |
REJECTED=0 | |
red="\033[31m" | |
reset="\033[m" |
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
#!ruby | |
# Usage: | |
# ruby psql.rb <VAR_NAME> | |
# | |
require 'URI' | |
name = ARGV[0] | |
starts_with_name = Regexp.new('^' + name) | |
uri = nil |
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/bash | |
# inspired in "Monitoring a web page for changes using bash" | |
# http://bhfsteve.blogspot.com.es/2013/03/monitoring-web-page-for-changes-using.html | |
# monitor.sh - Monitors a web page for changes | |
# sends an email notification and a tweet if the file changes | |
# requirements: | |
# - twitter from the command line [https://github.com/sferik/t] | |
# gem install t | |
# - sendemail |
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
curl -s 'http://api.ipify.org' | pbcopy |
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
# forward port YYYY to remote-host:XXXX | |
forwarder-host$ mkfifo fifo_port_XXXX | |
forwarder-host$ nc -k -l YYYY 0<fifo_port_XXXX | nc remote-host XXXX 1>fifo_port_XXXX | |
# now we can access remote-host:XXXX in a machine with access only thru forwarder-host | |
local-host$ curl forwarder-host:YYYY | |
<output from remote-host server> |