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
LUAOBJECT_GRAMMAR = %q{ | |
grammar LuaObject | |
rule luaobj | |
space value space { def to_ruby; value.to_ruby; end } | |
end | |
rule value | |
nil / float / number / string / table / boolean | |
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
;; | |
;; Mimic Windows7 window positions using Win+Up/Left/Right | |
;; Not tested with multiple monitors | |
;; | |
#up:: | |
WinRestore A | |
WinMaximize A | |
return |
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
require 'socket' | |
def local_ip | |
orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true | |
UDPSocket.open do |s| | |
s.connect '8.8.8.8', 1 | |
s.addr.last | |
end | |
ensure | |
Socket.do_not_reverse_lookup = orig | |
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
# Function for setting up precompiled headers. Usage: | |
# | |
# add_library/executable(target | |
# pchheader.c pchheader.cpp pchheader.h) | |
# | |
# add_precompiled_header(target pchheader.h | |
# [FORCEINCLUDE] | |
# [SOURCE_C pchheader.c] | |
# [SOURCE_CXX pchheader.cpp]) | |
# |
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
require 'net/imap' | |
require 'open-uri' | |
if not File.exist?('cacert.pem') | |
puts "Downloading CA certificates" | |
open('http://curl.haxx.se/ca/cacert.pem') do |f| | |
File.open('cacert.pem', 'wb') { |of| of << f.read } | |
end | |
end | |
cert = File.expand_path('cacert.pem') | |
# Net::IMAP.debug = true |
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
def which(file) | |
exts = [""] + (ENV["PATHEXT"]||"").split(File::PATH_SEPARATOR) | |
ENV["PATH"].split(File::PATH_SEPARATOR).map do |path| | |
exts.map do |ext| | |
filepath = File.join(path, file + ext) | |
defined?(File::ALT_SEPARATOR) && File::ALT_SEPARATOR && filepath.tr!(File::SEPARATOR, File::ALT_SEPARATOR) | |
filepath if File.exist?(filepath) | |
end | |
end.flatten.compact.first | |
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
#!/bin/sh -ex | |
wget -nc http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz | |
wget -nc http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz | |
wget -nc http://llvm.org/releases/3.3/compiler-rt-3.3.src.tar.gz | |
wget -nc http://llvm.org/releases/3.3/clang-tools-extra-3.3.src.tar.gz | |
rm -rf llvm | |
mkdir -p llvm | |
tar xfz llvm-3.3.src.tar.gz -C llvm --strip-components=1 | |
mkdir -p llvm/tools/clang | |
tar xfz cfe-3.3.src.tar.gz -C llvm/tools/clang --strip-components=1 |
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 -ex | |
wget -N http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz | |
wget -N http://llvm.org/releases/3.4/clang-3.4.src.tar.gz | |
wget -N http://llvm.org/releases/3.4/clang-tools-extra-3.4.src.tar.gz | |
wget -N http://llvm.org/releases/3.4/compiler-rt-3.4.src.tar.gz | |
mkdir -p llvm | |
tar xfz llvm-3.4.src.tar.gz -C llvm --strip-components=1 | |
mkdir -p llvm/tools/clang | |
tar xfz clang-3.4.src.tar.gz -C llvm/tools/clang --strip-components=1 | |
mkdir -p llvm/tools/clang/tools/extra |
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 ruby | |
# | |
# Script that makes updating Visual Studio Solutions from CMakeLists' | |
# easier, by closing the solution via COM and automatically re-running | |
# CMake in the corresponding build directory, then reopening and | |
# building the solution. | |
# | |
# Simply run 'cmakevs.rb' from the command line, and it will find an | |
# instance of Visual Studio and detect the open solution and re-run | |
# CMake. |
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 ruby | |
# | |
# b - a cmake convinience tool | |
# | |
# Runs build commands (e.g. cmake --build ., ctest, etc) in the | |
# corresponding build directory, from the source directory. For | |
# example, this command automatically starts a build in the associated | |
# build directory: | |
# | |
# c:\source\git\repo> b |
OlderNewer