Skip to content

Instantly share code, notes, and snippets.

Kyriacos Souroullas kyriacos

Block or report user

Report or block kyriacos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:b5e44bff64539e6e664c9fc5c30c701d
### 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:
View .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
View README
Basic atom config for work.
@kyriacos
kyriacos / useful-unix-commands.md
Last active Jan 4, 2016
Useful unix commands (practical quick examples)
View useful-unix-commands.md

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

View Hybrid.itermcolors
<?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>
View carrierwave_init.rb
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'}
View friendly_urls.markdown

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 Mar 22, 2012 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide
View gist:2162649

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 Jan 26, 2012 — forked from peterc/dnsd.rb
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
View dnsd.rb
# 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
You can’t perform that action at this time.