Skip to content

Instantly share code, notes, and snippets.

View ismailmechbal's full-sized avatar

Ismail Mechbal ismailmechbal

View GitHub Profile
@ismailmechbal
ismailmechbal / ahoy_base.rb
Created June 19, 2017 15:21 — forked from jabbett/ahoy_base.rb
Setting up Ahoy models to use a separate datastore
module Ahoy
class AhoyBase < ActiveRecord::Base
establish_connection DB_STATS
self.abstract_class = true
end
end
@ismailmechbal
ismailmechbal / .rubocop.yml
Created June 8, 2017 21:27 — forked from jhass/.rubocop.yml
My preferred Rubocop config
AllCops:
RunRailsCops: true
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
{
"expand": "full",
"id": 650669458,
"title": "Running: Trail",
"sport": 0,
"start_time": "2015-12-31T13:32:17.000Z",
"local_start_time": "2015-12-31T14:32:17.000+01:00",
"distance": 6.08037,
"duration": 2209.303,
"speed_avg": 9.90779988077688,
@ismailmechbal
ismailmechbal / sketch-never-ending.md
Last active January 28, 2022 04:23
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@ismailmechbal
ismailmechbal / curl.md
Created September 14, 2016 08:05 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@ismailmechbal
ismailmechbal / routes.md
Created September 14, 2016 06:40 — forked from dideler/routes.md
Rails Routes

A summary of the Rails Guides on Routes, plus other tips.

The Rails router recognizes URLs and dispatches them to a controller's action. It can also generate paths and URLs, avoiding the need to hardcode strings in your views.

Examples

# Redirects /orders/report to orders#report.
get 'orders/report', to: 'orders#report'

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

@ismailmechbal
ismailmechbal / derewecki-resume.txt
Created August 8, 2016 09:12 — forked from derwiki/derewecki-resume.txt
Resume for Adam Derewecki
A D A M D E R E W E C K I
1200 Sacramento St. Apt 405, San Francisco, CA 94108 740-502-3073
[email protected] github.com/derwiki
== P R O F E S S I O N A L E X P E R I E N C E ==
CameraLends, Founder/CEO and Engineer (1/2013 - Present)
* Hackers and Founders startup incubator participant
* Tech stack: Rails 4.2/Bootstrap/jQuery/Heroku
* Integrated: Facebook Login, Twitter, Twilio, Sift Science, Slack, Google
Geocoder, Segment, Asana, Intercom, oLark, Zendesk
@ismailmechbal
ismailmechbal / README.md
Created March 7, 2016 07:07 — forked from derwiki/README.md
Ruby module that you can use in a `before_action` on sensitive controllers for which you'd like a usage audit trail

Adding an audit log to your Rails app

If you have any sort of administrative interface on your web site, you can easily imagine an intruder gaining access and mucking about. How do you know the extent of the damage? Adding an audit log to your app is one quick solution. An audit log should record a few things:

  • controller entry points with parameter values
  • permanent information about the user, like user_id
  • transient information about the user, like IP and user_agent

Using the Rails framework, this is as simple as adding a before_action to your admin controllers. Here’s a basic version that I’m using in production.

@ismailmechbal
ismailmechbal / 0. nginx_setup.sh
Created February 22, 2016 11:58 — forked from mikhailov/0. nginx_setup.sh
NGINX+SPDY with Unicorn. True Zero-Downtime unless migrations. Best practices.
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#