Skip to content

Instantly share code, notes, and snippets.

View miclovich's full-sized avatar
😇
Working, what else?

Victor miclovich

😇
Working, what else?
View GitHub Profile
var http = require('http');
var url = require('url');
var parse = require('url').parse;
var join = require('path').join;
var fs = require('fs');
var qs = require('querystring');
var root = __dirname;
var items = [];
var loaded_page = false;
@miclovich
miclovich / gist:cd6b3c543111f8162ffc
Created February 21, 2015 23:56
Rails workflow
VISION for an MVP (minimum viable product) // User story
==========================================
Create a competition [Iteration I]
--------------------
- football games
- picking winners
e.g Duke vs Carolina

become active record migration expert (Rails 4.0.2)

workflow:

create model

$ rails g model NameOfModel
    invoke  active_record
    create    db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb

Massive file upload using JQueryUpload + Nginx + Rails + Sidekiq

The goal: Upload several files (virtually big files) to a Rails application without compromising the user experience.

Architecture

jQuery File Upload + Nginx + Rails (Carrierwave) + Sidekiq

  1. jQuery File Upload (http://blueimp.github.io/jQuery-File-Upload/)
"""
slidingPuzzle.py
Emily Johnston
4/26/2014
A command-line, single-player sliding puzzle game of customizable size and difficulty.
"""
import sys
from random import choice
# app/controllers/users/password_controller.rb
class Users::PasswordsController < Devise::PasswordsController
def resource_params
params.require(:user).permit(:email, :password, :password_confirmation)
end
private :resource_params
end

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev

@miclovich
miclovich / mr_demo.py
Created August 22, 2013 17:32
mr_demo.py
"""
DemoTime
========
About
-----
DemoTime is a simple app that searches the Twitter API for what your
namesake or any other name(someone with your name, other than you) might have said.
It uses the twitter Search API to search for stuff; once that is found, it sends you a
message of the tweet to your phone; it will only send a tweet that has more than 5
@miclovich
miclovich / findrange.java
Created June 10, 2013 14:54
sorting and making your life a whole lot easier
/*
* File: FindRange.java
* Name:
* Section Leader:
* --------------------
* This file is the starter file for the FindRange problem.
*/
import java.util.ArrayList;