Skip to content

Instantly share code, notes, and snippets.

View Codcore's full-sized avatar

Andrej Yaroshuk Codcore

View GitHub Profile
@Codcore
Codcore / gist:0c7a331b69eed542fb78
Last active August 29, 2015 14:22
Amethyst web framework benchmark

Here are result of Amethyst benchmarking with wrk:

./wrk -d 60 -t 10 -c 200 http://127.0.0.1:8080/
Running 1m test @ http://127.0.0.1:8080/
  10 threads and 200 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     5.24ms  548.04us  16.95ms   85.04%
    Req/Sec     3.83k   223.66     4.42k    82.93%
  2290956 requests in 1.00m, 9.71GB read
Requests/sec: 38157.50
@Codcore
Codcore / gist:cfa0b90da68cebc8a3e4
Created June 8, 2015 13:21
Installing Crystal 0.7.3 Manjaro Linux
Pending:
Code gen: lib codegens lib var set and get
Code gen: primitives codegens pointer of int
Code gen: primitives sums two numbers out of an [] of Number
Code gen: virtual type calls class method 1
Code gen: virtual type calls class method 2
Code gen: virtual type calls class method 3
Type inference: cast casts from union to incompatible union gives error
Type inference: def overload restricts on generic type with free type arg
Type inference: def overload restricts on generic type without type arg
$view = "view"
class View
  def initialize()
    @name = "Andrew"
  end

  ecr_file("#{__DIR__}/#{$view}.ecr")
end
# require "./rsaccess-web/*"
require "../../src/amethyst"
module Rsaccess::Web
class WordController < Base::Controller
actions :login
view "login", "#{__DIR__}/views"
view "success", "#{__DIR__}/views", username, password
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Login Page</title>
<style>
/* Basics */
html, body {
width: 100%;
height: 100%;
Nope, username or password are incorrect !
2.5.1 :002 > require 'bundler'
2.5.1 :005 > definition = Bundler::Definition.build("Gemfile", nil, nil)
=> #<Bundler::Definition:0x000055ad3a1f8c08 @unlocking_bundler=nil, @unlocking=false, @dependencies=[<Bundler::Dependency type=:runtime name="bundler-whatsup" requirements=">= 0">, <Bundler::Dependency type=:development name="bundler" requirements="~> 1.16">, <Bundler::Dependency type=:development name="rake" requirements="~> 10.0">, <Bundler::Dependency type=:development name="rspec" requirements="~> 3.0">, <Bundler::Dependency type=:development name="cucumber" requirements=">= 0">, <Bundler::Dependency type=:development name="aruba" requirements=">= 0">, <Bundler::Dependency type=:development name="simplecov" requirements=">= 0">, <Bundler::Dependency type=:development name="json" requirements=">= 0">], @sources=#<Bundler::SourceList:0x000055ad3a1b39c8 @path_sources=[#<Bundler::Source::Gemspec:0x47101246656020 source at `.`>], @git_sources=[], @plugin_sources=[], @global_rubygems_source=nil, @rubygems_ag
rubycoder@shehinacode ~ $ ncat -C httpbin.org 80 [ruby-2.6.0]
GET /anything HTTP/1.1
Host: httpbin.org
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Thu, 21 Feb 2019 11:16:58 GMT
Server: nginx
@Codcore
Codcore / SQL
Last active February 25, 2019 14:27
1.)
test_guru=# CREATE TABLE categories (
test_guru(# id SERIAL PRIMARY KEY,
test_guru(# title TEXT
);
CREATE TABLE
@Codcore
Codcore / hello_world.py
Created March 23, 2019 20:06
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()