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 'win32ole' | |
opc_automation = WIN32OLE::new 'OPC.Automation' | |
# get list of servers | |
opc_automation.GetOPCServers | |
# Connect to specific server | |
opc_automation.connect 'Matrikon.OPC.Simulation.1' | |
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
#old style | |
a={} | |
a[:test] = {} | |
a[:test][:second_test] = 'Hello hash!' | |
# new style | |
# emulates working with directories | |
b = {} | |
b/:test = {} | |
b/:test/:second_test = 'Hello hash!' |
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
if empty(glob('~/.vim/autoload/plug.vim')) | |
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
endif | |
call plug#begin('~/.vim/plugged') | |
Plug 'altercation/vim-colors-solarized' | |
Plug 'elixir-lang/vim-elixir' |
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
[user] | |
name = Tallak Tveide | |
email = [email protected] | |
[core] | |
editor = /usr/bin/vim | |
excludesfile = /cygdrive/c/Users/tveidet/.gitignore_global | |
autocrlf = false | |
[diff "excel"] | |
textconv = strings | |
[diff "word"] |
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
# http://code.google.com/p/apt-cyg/ | |
apt-cyg show | |
The following packages are installed: | |
_autorebase | |
_update-info-dir | |
alternatives | |
autoconf | |
autoconf2.1 | |
autoconf2.5 |
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
class TableHash | |
# creates a Hash from a table structure | |
# | |
# TableHash[ | |
# 4, | |
# :key, :a, :b, :c, | |
# 'first', 10, 11, 12, | |
# 'second', 20, 30, 40 | |
# ] | |
# |
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 'ffi' | |
require 'socket' | |
require_relative 'nodave_constants' | |
module Nodave | |
include NodaveConstants | |
extend FFI::Library | |
ffi_lib 'libnodave' |
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 perl -w | |
# To run on linux, install the following packages: | |
# sudo apt-get install libdbd-xbase-perl | |
# sudo apt-get install libdbi-perl | |
# | |
# To run without downloading and creating the perl file, type: | |
# cd /path/to/step7/project | |
# curl -s -L https://raw.github.com/gist/3899286/s7unprotect.pl | perl | |
# |
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
$excel.Range('A4').Value = 'Remote Set' |
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
class Hash | |
class << self | |
def from_block() | |
Hash[Enumerator.new {|yielder| yield yielder }.to_a] | |
end | |
end | |
end | |
Hash::from_block do |yielder| |
OlderNewer