Skip to content

Instantly share code, notes, and snippets.

View tsyber1an's full-sized avatar
🎯
Focusing

Tsyren O. tsyber1an

🎯
Focusing
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="c3/bower_components/d3/d3.min.js"></script>
<script type="text/javascript" src="c3/c3.js"></script>
</head>
<body>
<div id='chart'></div>
<script type="text/javascript">
@tsyber1an
tsyber1an / README.md
Last active August 29, 2015 14:18
Kafka 0.8.2 quick start

Step 1. Installation

ZooKeeper

$ wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org/zookeeper/stable/zookeeper-3.4.6.tar.gz 
$ tar -xvf zookeeper-3.4.6.tar.gz 
$ cd zookeeper-3.4.6/ 
$ cp conf/zoo_sample.cfg conf/zoo.cfg 
$ bin/zkServer.sh 
#!/bin/bash
# Create the directory structure
mkdir -p features/step_definitions
mkdir -p features/support
# Create a placeholder for the step_definitions folder
touch features/step_definitions/"$(basename `pwd`)_steps.rb"
# Create the environment file
package main
import "fmt"
func main() {
in := gen(1, 19, 122)
for n := range in {
fmt.Println(n)
}
}
@tsyber1an
tsyber1an / app.rb
Last active August 29, 2015 14:12 — forked from runemadsen/app.rb
require 'sinatra'
get "/" do
erb :form
end
post '/save_image' do
@filename = params[:file][:filename]
file = params[:file][:tempfile]
@tsyber1an
tsyber1an / Gemfile
Created December 22, 2014 08:33
Sinatra + EventMachine
source "https://rubygems.org"
ruby "2.1.5"
gem 'sinatra'
gem 'thin'
gem 'foreman'
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
module Harmony
# Allows accessing config variables from harmony.yml like so:
# Harmony[:domain] => harmonyapp.com
def self.[](key)
unless @config
raw_config = File.read(RAILS_ROOT + "/config/harmony.yml")
@config = YAML.load(raw_config)[RAILS_ENV].symbolize_keys
end
@config[key]
end
@tsyber1an
tsyber1an / stuff.md
Last active August 29, 2015 14:11
Rails stuff
require 'Benchmark'
def balanced_delimiters?(text)
openers = []
matchers = {
')' => '(',
']' => '[',
'}' => '{'
}
text.chars.each do |char|