Skip to content

Instantly share code, notes, and snippets.

@bolthar
bolthar / fresh_install.sh
Created October 20, 2009 14:37
Fresh install base script
#!/bin/sh
ssh-keygen
cat .ssh/id_rsa.pub
echo "Waiting for you to add keys..."
read dummy
sudo apt-get update
sudo apt-get install ruby -y
sudo apt-get install ruby1.8-dev -y
sudo apt-get install ruby1.9 -y
sudo apt-get install ruby1.9-dev -y
# no OOP
value = "a" #somewhere else
if value == "a"
print "a!"
elsif value == "b"
print "b!"
elsif value == "c"
print "c!"
using System.Windows;
namespace WpfApplication1
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var viewmodel = new TestViewModel(new TestWindow());
require 'rubygems'
require 'libglade2'
class GtkDefinition
attr_reader :definition
def initialize
@definition = '<?xml version="1.0"?>
<interface>
class MangaViewModel < FreightViewModel
signal :update_progress
region :mangas
region :chapters
region :page
region :control_box
class CLF(object):
#snip
def handle_cl(self):
#snip
if params and params[0]:
self.__input_stream = FileStream(params[0], 'r')
else:
self.__input_stream = IOStream(sys.stdin)
@bolthar
bolthar / gist:630911
Created October 17, 2010 14:40
BindingToComboBox
#viewmodel file (my_view_model.rb, in /viewmodels)
class MyViewModel < FreightViewModel
def my_list
return ['my', 'list', 'of', 'strings']
end
end
@bolthar
bolthar / gist:1438286
Created December 6, 2011 13:56
Marshalling
class Test
attr_reader :value
def self.value_by_block(&block)
@evaluator = block
end
def initialize
@value = self.class.instance_variable_get(:@evaluator).call
@bolthar
bolthar / war.rb
Created October 25, 2012 23:55
War!
A = 14
SPADES = :s
DIAMONDS = :d
HEARTS = :h
CLUBS = :c
SUITS = [SPADES, DIAMONDS, HEARTS, CLUBS]
class Card
This file has been truncated, but you can view the full file.
apiVersion: argoproj.io/v1Alpha
kind: Workflow
metadata:
generateName: job-10066-
spec:
entrypoint: job-10066
onExit: finalizer
templates:
- name: log-handler
container: