Skip to content

Instantly share code, notes, and snippets.

View costis's full-sized avatar
🎯
Focusing

Costis Panagiotopoulos costis

🎯
Focusing
View GitHub Profile
# Do a `gem install rack` first
#
# Running with `puma -t 1` we see the request blocking.
# Running with `puma` there is no blocking (default is `-t 16`)
#
# Maybe filler is not thread safe and we have a rece condition somewhere.
# If this is the case, running `puma -t 1 -w 10` should work fine (10 processes, 1 thread for process).
require "rack"
@costis
costis / cvimrc
Last active September 28, 2018 11:25
let blacklists = ["https://mail.google.com/*","https://*.github.com/*","https://github.com/*", "http://devdocs.io"]
#!/bin/bash
#
# This script will mount /Users in the boot2docker VM using NFS (instead of the
# default vboxsf). It's probably not a good idea to run it while there are
# Docker containers running in boot2docker.
#
# Usage: sudo ./boot2docker-use-nfs.sh
#
function Bar() {
Foo.call(this);
}
Bar.prototype = Object.create(Foo.prototype);
Bar.prototype.constructor = Bar;
Foo.prototype.thing = function() {}
@costis
costis / .cVimrc
Last active August 29, 2015 14:07
" Settings
set noautofocus
set cncpcompletion
set nosmoothscroll
set nohud
set autohidecursor
set typelinkhints
let scrollduration = 10
let searchlimit = 40
@costis
costis / git_svn.markdown
Created June 11, 2014 11:58
Git and SVN, Subversion

Create a git clone of that includes your Subversion trunk, tags, and branches with

git svn clone http://svn.example.com/project -T trunk -b branches -t tags

The --stdlayout option is a nice shortcut if your Subversion repository uses the typical structure:

git svn clone http://svn.example.com/project --stdlayout

Make your git repository ignore everything the subversion repo does:

@costis
costis / ReST Questions
Created August 10, 2013 10:49
Questions about ReST
### Questions
1. Should api version go in the URL or accept header?
2. Should representation type go in the url or accept header?
3. Are custom HTTP verbs okay?
4. Should GET, POST, PUT and DELETE map one-to-one to CRUD? Most say no, but other seeming authorities say it's fine.
5. Should you ever return a URL template, and a set of entity identifiers that can be plugged in, or should you only return the fully formed URLs?
6. What is the difference between a URL and a URI? (And all you who say this one is dead simple and I'm an idiot for not knowing, see if your answers actually agree with each other)
7. Are two different language translations of a document different resources, or are they different representations of the same resource?
8. If two different language translations are just different representations of the same resource, how should the client indicate which version it wants?

Was asked to look at this thing again; only reviewed the JS portion. Last I checked, the CSS was similarly reality-challenged. Graphics are nice, but are tantamount to the paint job on a used car. Under the hood, this thing is all junk. It's hard to imagine the innards of any Web or mobile device-based application would end up like this, which raises the question of whether the authors have ever written such applications (or any amount of meaningful JS).

/**
 * @class Ext
 * @singleton

There (still) are no "classes" or "singletons" in JS (starting off on the wrong foot by mangling JS terms).

@costis
costis / Ruby one liner http
Created July 9, 2013 10:21
Ruby one liner to run a web server from console
ruby -run -e httpd . -p5000
@costis
costis / gist:5661903
Created May 28, 2013 10:38
Task from Alek
log = [
{time: 201202, a: 3},
{time: 201201, y: 7},
{time: 201201, z: 2},
{time: 201202, b: 4},
{time: 201202, c: 0},
{time: 201201, x: 2}
]
log.inject([]) do |acc, item|