Skip to content

Instantly share code, notes, and snippets.

Kenneth John kennethjohnbalgos

Block or report user

Report or block kennethjohnbalgos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View refresh_trend_data
def refresh_trend_data
@begin_date = (Date.today - 3.months).end_of_week(:sunday)
@end_date = Date.today.end_of_week(:sunday)
@begin_date = @chart.trend_start_date.end_of_week(:sunday) if @chart.trend_start_date
@end_date = @chart.trend_end_date.end_of_week(:sunday) if @chart.trend_end_date
if @chart.trend_all_movements
@displayed_movements = @movements
else
@kennethjohnbalgos
kennethjohnbalgos / trend_tracker_process
Created Mar 25, 2015
/charts/update_trend_movements
View trend_tracker_process
Started POST "/charts/update_trend_movements" for 127.0.0.1 at 2015-03-25 16:28:50 +0800
Processing by ChartsController#update_trend_movements as JS
Parameters: {"utf8"=>"✓", "authenticity_token"=>"Mnv8ruZDOi5a+Yr41lN2Hu2UIroqwkhAaKyv4syu6ho=", "all"=>"false", "movements"=>["7151", "7138", "7013", "7175", "7176", "7177", "7178", "5994", "7868", "5570", "7536", "7537", "7538", "7834", "7395", "6708", "7164", "8261", "8262", "8265", "8266", "8267", "7686", "8259", "8260"], "start_date"=>"2014-11-01", "end_date"=>"2014-11-30", "commit"=>"Update Chart"}
User Load (1.8ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 2200843 LIMIT 1
Person Load (1.6ms) SELECT `people`.* FROM `people` WHERE `people`.`user_id` = 2200843 LIMIT 1
Chart Load (1.6ms) SELECT `charts`.* FROM `charts` WHERE `charts`.`person_id` = 2370365 AND (chart_type = 'trend') LIMIT 1
ChartOrganization Load (15.7ms) SELECT `chart_organizations`.* FROM `chart_organizations` WHERE `chart_organizations`.`chart_id` = 1019
EXPLAIN (1.8m
View SP Import Logs
-- Checking Ministry - Athletes In Action
---- Importing Projects 2014...
---- Importing Projects 2015...
------ Checking Project - 2015 - South Asia Project
------ Checking Project - 2015 - South Korea
-- Checking Ministry - Bridges
---- Importing Projects 2014...
---- Importing Projects 2015...
------ Checking Project - 2015 - Bridges Chinese Trek - Boston
------ Checking Project - 2015 - Bridges Chinese Trek - East Asia
View brian-ellis-profile
{
"person": {
"interactions": [
{
"interaction_type_id": 1,
"created_by_id": 55270,
"privacy_setting": "organization",
"updated_at": "2012-11-18T04:10:46+08:00",
"initiator_ids": [
View Lesson Types
INSERT INTO `lesson_types` (`id`, `account_id`, `name`, `created_at`, `updated_at`)
VALUES
(1, 0, 'eLearning Lesson', '2014-09-06 08:39:07', '2014-09-06 08:39:07'),
(2, 0, 'SCORM', '2014-09-06 08:39:07', '2014-09-06 08:39:07'),
(3, 0, 'Webinar', '2014-09-06 08:39:07', '2014-09-06 08:39:07'),
(4, 0, 'Recording', '2014-09-06 08:39:07', '2014-09-06 08:39:07'),
(5, 0, 'Self-study', '2014-09-06 08:39:07', '2014-09-06 08:39:07'),
(6, 0, 'White Paper', '2014-09-06 08:39:07', '2014-09-06 08:39:07'),
(7, 0, 'Project', '2014-09-06 08:39:07', '2014-09-06 08:39:07'),
(8, 0, 'Mentoring', '2014-09-06 08:39:07', '2014-09-06 08:39:07'),
View application.html.haml
:javascript
var switchTo5x=true;
var isFirefox = typeof InstallTrigger !== 'undefined';
var isChromium = window.chrome,
vendorName = window.navigator.vendor;
var isChromeActive = (isChromium !== null && isChromium !== undefined && vendorName === "Google Inc.");
<<<<<<< HEAD
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
View shopping.rb
class Shopping
ICON_URL = "http://www.google.com/s2/favicons?domain="
# Metro Deal
METRODEAL_URL = "http://www.metrodeal.com/"
METRODEAL_SURL = "#{METRODEAL_URL}catalog/?q="
def self.metrodeal(page)
items = Array.new
page.css("body div.deals-content .deals-item-container").each do |data|
items << metrodeal_info(data)
end
@kennethjohnbalgos
kennethjohnbalgos / gist:10446161
Last active Aug 29, 2015
MissionHub Summer Project Import 1 [Staging]
View gist:10446161
-- Checking Ministry - Athletes In Action
---- Importing Projects 2014...
-- Checking Ministry - Cru High School
---- Importing Projects 2014...
-- Checking Ministry - Campus Field Ministry
---- Importing Regions...
------ Checking Region - GL - Great Lakes
-------- Importing Projects 2014...
---------- Checking Project - 2014 - CRU ABROAD: Haiti (Fall Semester 2012)
------ Checking Region - GP - Great Plains
@kennethjohnbalgos
kennethjohnbalgos / network.rb
Created Nov 28, 2013
Ruby Mobile Network Method [Nov2013]
View network.rb
def network?(min)
prefix = min.to_s[0..3]
if ['0813', '0907', '0908', '0909', '0910', '0912', '0918', '0919', '0920', '0921', '0928', '0929', '0930', '0938', '0939', '0946', '0947', '0948', '0949', '0989', '0998', '0999'].include?(prefix)
return "smart"
elsif ['0817', '0905', '0906', '0915', '0916', '0917', '0926', '0927', '0935', '0936', '0937', '0994', '0996', '0997'].include?(prefix)
return "globe"
elsif ['0922', '0923', '0925', '0932', '0933', '0934', '0942', '0943'].include?(prefix)
return "sun"
else
return nil
You can’t perform that action at this time.