Skip to content

Instantly share code, notes, and snippets.

@AlexVKO
AlexVKO / palestra-tdc2014-florianopolis
Created October 16, 2015 23:01 — forked from brunogh/palestra-tdc2014-florianopolis
Palestras TDC 2014 - Florianópolis
Palestras TDC 2014 - Florianópolis
Watir
Lucas Prim
http://www.slideshare.net/lucasprim/apresentacao-watir
RSpec Best Friends
Mauro George
http://pt.slideshare.net/maurogeorge/rspec-best-friends-34875731
@AlexVKO
AlexVKO / title-case-filter.js
Created December 9, 2015 19:01 — forked from jeffjohnson9046/title-case-filter.js
A title-case filter for AngularJs
// Came from the comments here: https://gist.github.com/maruf-nc/5625869
app.filter('titlecase', function() {
return function (input) {
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
input = input.toLowerCase();
return input.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(match, index, title) {
if (index > 0 && index + match.length !== title.length &&
match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" &&
(title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&
@AlexVKO
AlexVKO / .vimrc
Created January 18, 2016 00:51 — forked from gosukiwi/.vimrc
.vimrc
" ---------------------- USABILITY CONFIGURATION ----------------------
" Basic and pretty much needed settings to provide a solid base for
" source code editting
" don't make vim compatible with vi
set nocompatible
" turn on syntax highlighting
syntax on
" and show line numbers
@AlexVKO
AlexVKO / ctags.setup
Created March 12, 2016 19:51 — forked from nazgob/ctags.setup
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
[
{ "keys": ["e", "u"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{ "keys": ["c"], "command": "enter_insert_mode",
@AlexVKO
AlexVKO / .gitconfig
Created October 20, 2016 18:58 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@AlexVKO
AlexVKO / ar_to_hash.rb
Created December 19, 2016 16:05 — forked from renancarvalhoo/ar_to_hash.rb
Convert any Activerecord to a hash with all it's related objects
class Serializer < Struct.new(:object)
#w.association_cache.keys.include?
def to_hash
@hash ||= hash_object(object)
end
private
def hash_object(object)
hash = {}
@AlexVKO
AlexVKO / 1-server.md
Created April 20, 2017 21:19 — forked from dragonjet/1-server.md
Setup Web Server on EC2 Amazon Linux AMI

Step 1: Server Credentials

This assumes you are now connected to the server via SSH.

  • sudo -s Enter root mode for admin access
  • groupadd devgroup Create new group to be later granted access to /var/www/html

Creating a new Root User

  • useradd -G root,devgroup masterdev Create new root user. Also add to the devgroup
  • passwd masterdev Change password for the new root user
  • At this point, you'll need to input your new root user's new password
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@AlexVKO
AlexVKO / aws-linux-ulimit.md
Created October 17, 2017 06:05 — forked from diegopacheco/aws-linux-ulimit.md
How to Set ulimit on amazon linux | CentOS based?
sudo vim /etc/security/limits.conf
ec2-user soft nofile 65536
ec2-user hard nofile 65536

root soft nofile 65536
root hard nofile 65536