Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

View benjohnson77's full-sized avatar

Ben Johnson benjohnson77

Serial Entrepreneur with successful exits and an active investor. Results-driven Leader skilled in managing high-functioning teams for exceptional outcomes.
View GitHub Profile
@benjohnson77
benjohnson77 /upapt.sh
CreatedJune 2, 2017 04:24— forked fromslickplaid/upapt.sh
Rackspace Ubuntu Server - Allow older system to get updates using apt with Rackspace's Mirrors
sudo sed -i -e's/mirror.rackspace.com\|archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
<divclass="ls-nav">
<ul>
<?php if($this->session->userdata('user_type_id') == 1 && $this->session->userdata('is_admin') != 1) { ?>
<li><ahref="<?=base_url()?>dashboard"<?=($this->uri->segment(1) == 'dashboard'?'class="active"':NULL)?>><spanclass="icon-dashboard"></span>Dashboard</a></li>
<li><ahref="<?=base_url()?>mail"<?=($this->uri->segment(1) == 'mail'?'class="active"':NULL)?>><spanclass="icon-mail"></span>Mail</a></li>
<li><ahref="<?=base_url()?>client"<?=($this->uri->segment(1) == 'client'?'class="active"':NULL)?>><spanclass="icon-client"></span>Clients</a></li>
<li><ahref="<?=base_url()?>company"<?=($this->uri->segment(1) == 'company'?'class="active"':NULL)?>><spanclass="icon-company"></span>Companies</a></li>
<li><ahref="<?=base_url()?>user"<?=($this->uri->segment(1) == 'user'?'class="active"':NULL)?>><spanclass="icon-user"></span>Users</a></li>
<li><ahref="<?=base_url()?>agent"<?=($this->uri->segment(1) == 'agent'?'class="active"':N
describe'product'do
before(:each)do
visit'/login'
fill_in'user_name',:with=>'admin'
fill_in'password',:with=>'Legalinc2015'
click_on'Sign in'
click_on'Products'
end
describe'stats'do
expect(page).tohave_select("input[name='client_status_id']",selected:'All')
expect(page).tohave_select("input[name='client_type_id']",selected:'All')
expect(page).tohave_select("input[name='distributor_id']', selected: 'All')
expect(page).to have_select('input[name='state']', selected: 'All')
expect(page).to have_field('client_name', with: '')
expect(page).to have_field('client_email', with: '')
expect(page).to have_field('client_phone', with: '')
functionalcGetUrlWithProtocol(url)
{
varuseSSL='https:'==document.location.protocol;
if(useSSL==true){
varnew_url=url.replace(/http:/,'https:');
}else{
varnew_url=url;
}
@benjohnson77
benjohnson77 /gist:5385f119efff85894247
CreatedJuly 23, 2014 23:08
refactor of the process_items vs process file
defself.process_file(uploaded_file)
items=[]
CSV.foreach(uploaded_file,headers:false)do |row|
items.push(row[0].to_i)
end
process_items(items)
end
defself.process_items(items)
clearancing_status=create_clearancing_status
@benjohnson77
benjohnson77 /gist:8695801
Last activeAugust 29, 2015 13:55
Quick script for mashing up pipedrive and contacturally
namespace:pipedrivedo
desc"Look into match up pipedrive with contactually"
require'httparty'
require'json'
task:import=>:environmentdo
require'csv'
filename=Rails.root +"lib/tasks/meetingplanners.csv"
@benjohnson77
benjohnson77 /gist:7108171
Last activeDecember 26, 2015 06:29
Comparing application performance on Rackspace vs Google Compute Engine
StartedGET"/books"for96.226.128.2at2013-10-2220:18:56 +0000
ProcessingbyWeb::BooksController#index as HTML
UserLoad(2.7ms)SELECT`users`.*FROM`users`WHERE`users`.`id` = 38 LIMIT 1
(2.4ms) SELECT COUNT(*) FROM `reading_actions` WHERE `reading_actions`.`user_id` = 38 AND `reading_actions`.`action_type` = 'have_read'
(75.2ms) SELECT COUNT(*) FROM `reading_actions` WHERE `reading_actions`.`user_id` = 38 AND `reading_actions`.`action_type` = 'want_to_read'
(54.7ms) SELECT COUNT(*) FROM `reading_actions` LEFT OUTER JOIN readings ON readings.reading_action_id = reading_actions.id WHERE `reading_actions`.`user_id` = 38 AND (reading_actions.readable_type in ('Book', 'SocialBook') AND reading_actions.action_type = 'reading_now') AND (CASE WHEN readings.is_private = 1 THEN readings.user_id = 38 ELSE 1 = 1 END)
Rendered shared/v2/_breadcrumb.haml (2.3ms)
(2.8ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM `reading_actions`LEFTOUTERJOINreadingsONreadings.readin
@benjohnson77
benjohnson77 /gist:7107825
Last activeDecember 26, 2015 06:29
SQL benchmark on 3 different cloud platforms.
I decided to add RDS environment to my testing. So I can compare AWS(RDS) to rackspace(Rack DB) to GCE (cloud-SQL) and this is what I find running the same benchmark on all three. GCE is in the same zone, and for comparison AWS server is also in the same zone as RDS.
benchmark I am using is perl test-wisconsin from sql bench
Google
Wisconsin benchmark test
Time for create_table (3): 1 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting data
Time to insert (31000): 317 wallclock secs ( 1.95 usr 2.09 sys + 0.00 cusr 0.00 csys = 4.04 CPU)
Time to delete_big (1): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
@benjohnson77
benjohnson77 /gist:6873279
Last activeDecember 24, 2015 22:29
Looks like google knife needed some additional OHAI plugin to produce the same data as the AWS-knife command.
➜ crockpot git:(master) ✗>knife bootstrap ---- ommitted -----
Bootstrapping Chef on 173.255.117.224
173.255.117.224 Starting Chef Client, version 11.6.0
173.255.117.224 resolving cookbooksfor run list: ["ohai","sudo","users::sysadmins","apt","git","snap","locales","imagemagick","logrotate","rvm::user","mysql","bookshout_passenger","bookshout_passenger::qa","instramentalapp_agent"]
173.255.117.224 Synchronizing Cookbooks:
173.255.117.224 - instramentalapp_agent
173.255.117.224 - bookshout_passenger
173.255.117.224 - openssl
173.255.117.224 - build-essential
173.255.117.224 - mysql
NewerOlder

[8]ページ先頭

©2009-2025 Movatter.jp