Skip to content

Instantly share code, notes, and snippets.

View kyriacos's full-sized avatar

Kyriacos Souroullas kyriacos

View GitHub Profile
### Keybase proof
I hereby claim:
* I am kyriacos on github.
* I am kyriacos (https://keybase.io/kyriacos) on keybase.
* I have a public key ASCuIinPfOilaiQ7n4XWUD5Bc8VXYSvSCCGXrM3nNVxHYwo
To claim this, I am signing this object:
@kyriacos
kyriacos / .eslintrc
Last active August 29, 2015 14:17 — forked from cletusw/.eslintrc
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
Basic atom config for work.
@kyriacos
kyriacos / useful-unix-commands.md
Last active January 4, 2016 14:59
Useful unix commands (practical quick examples)

Find

find files using name in the current directory

find . -name filename.txt

find files ignoring case

find / -type d -name filename

find all rb file with name

find . -type f -name *.rb

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.13528014719486237</real>
<key>Green Component</key>
<real>0.12312769144773483</real>
@kyriacos
kyriacos / carrierwave_init.rb
Created June 29, 2012 04:13
Carrierwave config
CarrierWave.configure do |config|
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: ENV['S3_KEY'],
aws_secret_access_key: ENV['S3_SECRET']
}
config.fog_directory = "client-" + Rails.env
config.fog_public = true
config.fog_attributes = {'Cache-Control' => 'max-age=315576000'}
@kyriacos
kyriacos / friendly_urls.markdown
Created May 12, 2012 00:40 — forked from agnellvj/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@kyriacos
kyriacos / gist:2162649
Created March 22, 2012 19:36 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@kyriacos
kyriacos / dnsd.rb
Created January 26, 2012 21:38 — forked from peterc/dnsd.rb
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL