Skip to content

Instantly share code, notes, and snippets.

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

Alex oivoodoo

🏠
Working from home
View GitHub Profile
require "net/https"
require "uri"
uri = URI.parse("https://secure.com/")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri)
/*
* Small serialize form snippet supporting one level nested attributes.
*/
$.fn.serializeObject = function() {
var o = {};
var a = this.serializeArray();
var pattern = /\[[\w\d\(\)_]+\]/;
$.each(a, function() {
var key = this.name;
var name = key.replace(/^\w+\[/, '').replace(/\]/, '');
(function(global) {
global.DateTime = DateTime = {};
DateTime.instance = (function() {
return {
getTime: function(date, gmt_offset) {
var date = DateTime.instance.getDate(date, gmt_offset);
return date.getHours() + ":" + date.getMinutes();
},
getDate: function(date, gmt_offset) {
window.oivoodoo = window.oivoodoo || {};
window.oivoodoo.tower = window.oivoodoo.tower || {};
window.oivoodoo.tower.utils = window.oivoodoo.tower.utils || {};
var namespace = window.oivoodoo.tower;
namespace.Statuses = {
START: 0,
STOP: 1,
PAUSE: 2
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
require 'json'
fork do
loop do
response = Net::HTTP.get_response(URI.parse('http://search.twitter.com/search.json?q=eng_trainer&rpp=1'))
json = JSON.parse response.body
require 'spec_helper'
describe AnalyticsController do
#integrate_views
before do
stub_isar_controllers
@account = Account.first
@user = User.first
#!/usr/bin/env ruby
# Script for learning english by twitter eng_trainer bot.
require 'rubygems'
require 'net/http'
require 'uri'
require 'json'
fork do
ls -1 | wc -l
# How to test application helpers via terminal.
# For example you are using devise.
# Type in terminal the next following lines.
class << self
def current_user
User.find_by_name("your username")
end
end
class GlobalSettingsController < AdminController
include Umaami::Controllers::WithoutAccountRelation
before_filter :load_global_settings
add_catch_exceptions :global_settings, :only => :update
def edit
end