Skip to content

Instantly share code, notes, and snippets.

param (
[ValidateNotNullOrEmpty()]
[string] $ScriptPath,
[ValidateNotNullOrEmpty()]
[string] $TaskName
# Pass in as many arguments as you want....
)
# Setup error handling.
Trap
@marcos2
marcos2 / 0.cs
Created May 29, 2018 14:12 — forked from up1/0.cs
Selenium with C# (Waiting)
webdriver.FindElement(By.Id("search_button")).Click();
Thread.Sleep(5000);
IWebElement searchResult = webdriver.FindElement(By.Id("search_result"));
@marcos2
marcos2 / emitter.service.ts
Created January 6, 2017 17:22 — forked from sasxa/emitter.service.ts
Angular2 Communicating between sibling components
import {Injectable, EventEmitter} from 'angular2/core';
@Injectable()
export class EmitterService {
private static _emitters: { [ID: string]: EventEmitter<any> } = {};
static get(ID: string): EventEmitter<any> {
if (!this._emitters[ID])
this._emitters[ID] = new EventEmitter();
return this._emitters[ID];
#!/usr/bin/env ruby
require "redis"
redis = Redis.new
redis.keys("*").each do |key|
val = case redis.type(key)
when "string"
redis.get key
when "list"
<!DOCTYPE html>
<!--[if lt IE 9]> <html class="ie"> <![endif]-->
<!--[if gte IE 9]> <html> <![endif]-->
<head>
<meta charset='utf-8'>
<meta content='width=device-width, initial-scale=1' name='viewport'>
<link href='/assets/favicon.ico' rel='shortcut icon' type='image/x-icon'>
<meta content='657722537612897' property='fb:app_id'>
<meta content='https://www.otvoreneministerstvo.sk' property='og:url'>
<meta content='Otvorené ministerstvo' property='og:title'>
//
// main.m
// algoritms2
//
// Created by Marek Rohon on 2/4/14.
// Copyright (c) 2014 Marek Rohon. All rights reserved.
//
#import <Foundation/Foundation.h>
@marcos2
marcos2 / gist:8568598
Created January 22, 2014 22:21
SELEDIUM
<!DOCTYPE html>
<html>
<head>
<title>NeoBlog</title>
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/articles.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/comments.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/scaffolds.css?body=1" media="all" rel="stylesheet" type="text/css" />

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
#RVM on Macbook air:
sudo bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
source .bash_profile
type rvm | head -1
rvm -v
rvm requirements
rvm install 1.9.2
rvm gemset create rails311
rvm gemset use rails311
gem install rails bundle rake --no-rdoc --no-ri