This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asdfsadf | |
Console.WriteLine("whatttttup"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private delegate void MyEventHandler(); | |
private void DownloadUpdates(MyEventHandler OnUpdate, MyEventHandler OnFinish) | |
{ | |
try | |
{ | |
SetProgress(5); | |
MessageLabel.Do(ctl => ctl.Text = AvailableUpdate.DownloadingUpdateLabelText); | |
//software updates always take precedence over data updates | |
SetProgress(50); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Application_Error(object sender, EventArgs e) | |
{ | |
Exception ex = Server.GetLastError(); | |
if (ex.GetType() != typeof(HttpException)) | |
{ | |
if (ex.GetType() == typeof(HttpUnhandledException) && ex.InnerException != null) | |
ex = ex.InnerException; | |
CoreManager.ExceptionService.HandleException(ex); | |
} | |
else if (ex.GetType() == typeof(HttpException)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Web.Mvc; | |
using System.Web; | |
using System.IO; | |
using Core.Service; | |
namespace NestleGFGL.Extensions.Helpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bindata' | |
module ServerConnection | |
def receive_data(data) | |
@buffer ||= [] | |
@data_size ||= 0 | |
@current_size ||= 0 | |
if @buffer.empty? | |
# First four characters of any framed message will always be the size of message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the base class for all Action processing classes. This is somewhat | |
# similar in concept to the Rails Controller/Action, and how the Rails router | |
# knows by convention what class/method to call. | |
class ActionBase | |
# Store all inherited classes. | |
def self.inherited(klass) | |
@actions ||= {} | |
@actions[klass.name] = klass | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Service approach | |
class EmployeeService | |
def delete(employee_id) | |
employee = Employee.find(employee_id) | |
delete_reviews(employee) | |
disable_feedback_access(employee) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ApplicationRecord | |
has_many :posts | |
has_many :comments | |
# id :integer not null, primary key | |
# name :string(50) default("") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> load '/private/var/folders/9q/0tnb0bwj5514jj4xl440f4j80000gn/T/sample.rb' | |
publish done | |
1 | |
2 | |
into 3 | |
Traceback (most recent call last): | |
12: from /Users/johnkchow/.rbenv/versions/2.5.1/bin/irb:11:in `<main>' | |
11: from (irb):1 | |
10: from (irb):1:in `load' | |
9: from /private/var/folders/9q/0tnb0bwj5514jj4xl440f4j80000gn/T/foo.rb:22:in `<top (required)>' |