Skip to content

Instantly share code, notes, and snippets.

View javierav's full-sized avatar
😎

Javier Aranda javierav

😎
View GitHub Profile
@plentz
plentz / nginx.conf
Last active April 18, 2024 12:42
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@willurd
willurd / web-servers.md
Last active April 18, 2024 14:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@machty
machty / router.md
Last active December 16, 2015 00:49
The smallest possible router refinement.

Proposal

  1. No longer encourage/allow external calls to a Route's transitionTo method.
  2. Instead, make use of a new routeTo event, with the same semantics as transitionTo, only that it's an event that routes can respond to.
  3. ApplicationRoute will have a default routeTo handler which passes its args to an internal transitionTo.
  4. URL changes will be converted into a routeTo event event.
@leviwilson
leviwilson / codmash_abstract_2013.md
Last active March 30, 2018 21:03
Abstract for Codemash 2014: Automating Windows Applications with Ruby.

Codemash 2014 Pre-Compiler

Automating Windows Applications with Ruby

Abstract

When we think of writing automated tests with ruby and cucumber, Windows desktop applications are not the first thing that come to mind. If you have looked into writing acceptance tests for Windows applications (native, WinForms or WPF), chances are you have come across solutions such as SpecFlow or Raconteur, but what are the options if we want to drive our tests from ruby using cucumber or RSpec?

This pre-compiler session will take you through building an acceptance test suite using some ruby gems (mohawk, RAutomation and cucumber) that tap into the Microsoft UI Automation accessibility framework to automate native, WinForms and WPF applications.

Target Audience

@tomdale
tomdale / gist:4263171
Created December 11, 2012 23:05
Ember Data Read-Only API Proposal

Read-Only

An important feature for Ember Data is providing helpful error messages when your application tries to do something that is forbidden by the data model.

To that end, we would like for the data model to be able to mark certain records, attributes, and relationships as read-only. This ensures that we can provide errors immediately, and not have to wait for a return trip from the adapter.

This also means that the adapter does not need to handle the case where an application developer inadvertently makes changes to a record that it does not conceptually make sense to modify on the client.

Requirements

@tomdale
tomdale / gist:4004913
Created November 2, 2012 23:10
Per-Type Adapters Proposal

Per-Type Adapter Hooks

Requirements

Many existing JSON APIs are not consistent between types. As JSON endpoints grew organically and were built by different engineers at different times, the style in which records are represented can vary wildly.

Historically, we have asked adapter authors to rely on the fact that the type of record is provided to all adapter hooks (either by passing a type argument, or by passing a record

@m3nd3s
m3nd3s / NERDTree.mkd
Last active November 23, 2023 13:45
My Vim Cheat Sheet

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

@clowder
clowder / multi_logger.rb
Created September 5, 2012 16:40
Logging to multiple destinations in Ruby
class MultiLogger
attr_reader :level
def initialize(args={})
@level = args[:level] || Logger::Severity::DEBUG
@loggers = []
Array(args[:loggers]).each { |logger| add_logger(logger) }
end
@adamjmurray
adamjmurray / gist:3154437
Created July 21, 2012 03:18
Managing Ruby gems programmatically
# Environment, set GEM_HOME & GEM_PATH. For example, we can launch JRuby like this:
# GEM_HOME=/Users/amurray/tmp/gems/ GEM_PATH=/Users/amurray/tmp/gems java -jar ~/Downloads/jruby-complete-1.7.0.preview1.jar -S irb
# =====================
# LISTING gems
puts Gem::Specification.find_all.to_s
puts Gem::Specification.find_all.map{|spec| "#{spec.name} (#{spec.version})" }
# =====================
# USING (a specific version of) gems
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 18, 2024 10:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname