Skip to content

Instantly share code, notes, and snippets.

View hayksaakian's full-sized avatar
🏠
Working from home

Hayk Saakian hayksaakian

🏠
Working from home
View GitHub Profile
@mariocesar
mariocesar / README.md
Last active August 29, 2015 14:04
Ubuntu Server + Nginx + Dropbox + uwsgi Apps

Install

Create a websites user.

sudo adduser --disabled-password --home /src/websites websites

Login and install dropbox.

sudo -s su - websites

@edelpero
edelpero / heroku_rails_phantomjs.md
Last active May 10, 2021 08:31
Heroku, Ruby on Rails and PhantomJS

#Heroku, Ruby on Rails and PhantomJS

In this post, I’m going to show you how to modify an existing Ruby on Rails app running on Heroku’s Cedar stack to use PhantomJS for screen scraping. If you’ve never heard of PhantomJS, it’s a command-line WebKit-based browser (that supports JavaScript, cookies, etc.).

Let’s get started. This is a high-level overview of the required steps:

  • Modify your app to use multiple Heroku buildpacks.
  • Extend your app to use both the Ruby as well as the PhantomJS buildpacks.
  • Confirm that everything worked.
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@dtuite
dtuite / checkers.js
Created January 29, 2013 10:02
Someone asked for the JS code from http://domainmasher.com so here it is.
// Service for checking the availability of a given word
Splitter.module('Checkers', function(Checkers, Splitter) {
var LocalChecker = {
comKeyFor: function(compound) {
return 'avail/.com/' + compound;
},
check: function(compound) {
@stammy
stammy / application_helper.rb
Created April 26, 2011 08:42
rails 3 pretty page titles. no more instance vars all up in your controllers
module ApplicationHelper
# pretty page titles
# yield_for(:title, 'default text goes here') in layout
# content_for(:title, 'some text') in view
def yield_for(content_sym, default)
output = content_for(content_sym)
output = default if output.blank?
output
end
end
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName example.com
# ServerAlias *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain