Skip to content

Instantly share code, notes, and snippets.

View kalyco's full-sized avatar

Kayla Comalli kalyco

  • 6 River Systems
  • Boston, MA
View GitHub Profile
@kalyco
kalyco / palindrome.cpp
Created July 6, 2018 21:59
Check if the linked list is a palindrome
// Linked List Question
// Check if the linked list is a palindrome
// set a node variable starting with mhead.
// Iterate through first half of LL
// append elements to a string
// if after first half, starting with last elem in array,
// compare to the first node. if != return false
// inc n each time.
@kalyco
kalyco / gist:f314f968c66f6f4eb613713ca92acf77
Last active February 5, 2018 22:11
Loopback 2 --> 3 Guide

Loopback 2.x --> 3.0

1. Package-Lock.json:

Change "loopback-datasource-juggler" to "strong-error-handler": “^1.0.1”,

npm install

@kalyco
kalyco / gist:675db74fa51af7f3a43443fe024ddbe5
Last active August 15, 2017 16:09
Boto3.Session.get_available_services()
# Instantiate an instance first, else Error: missing 1 required positional argument: 'self'
['acm', 'apigateway', 'application-autoscaling', 'appstream', 'athena', 'autoscaling', 'batch',
'budgets', 'clouddirectory', 'cloudformation', 'cloudfront', 'cloudhsm', 'cloudsearch', 'cloudsearchdomain',
'cloudtrail', 'cloudwatch', 'codebuild', 'codecommit', 'codedeploy', 'codepipeline', 'codestar',
'cognito-identity', 'cognito-idp', 'cognito-sync', 'config', 'cur', 'datapipeline', 'dax', 'devicefarm',
'directconnect', 'discovery', 'dms', 'ds', 'dynamodb', 'dynamodbstreams', 'ec2', 'ecr', 'ecs', 'efs', 'elasticache',
'elasticbeanstalk', 'elastictranscoder', 'elb', 'elbv2', 'emr', 'es', 'events', 'firehose', 'gamelift', 'glacier',
'greengrass', 'health', 'iam', 'importexport', 'inspector', 'iot', 'iot-data', 'kinesis', 'kinesisanalytics',
'kms', 'lambda', 'lex-models', 'lex-runtime', 'lightsail', 'logs', 'machinelearning', 'marketplace-entitlement',
'marketplacecommerceanalytics', 'meteringmarketplace', 'mturk', '
@kalyco
kalyco / kvm-setup.md
Last active December 20, 2016 19:50
setting up a kvm

Virtualization: Switching from OpenVZ to KVM

KVM stands for Kernel-based Virtual Machine. It is the infrastructure used to turn a Linux kernel into a hypervisor, also called a VNM (virtual machine monitor). Think of the main computer as a host machine, and each virtual instance running on it as a guest machine.

Because KVM is already part of the Linux kernel, is doesn't require additional software installations, so is not as complicated as other hypervisors can be.

KVM also executes full virtualization, as opposed to a virtualizor like OpenVZ in this case, where the host's kernel is shared with guest containers inside it.

Now we you have some background let's get started with the moving process:

@kalyco
kalyco / kvm_install.md
Last active December 2, 2016 14:54
installing kvm

Virtualization: Installing KVM

When setting up your network, you may find yourself continuously asking "Why?".
"Why?", you will ask, "am I not monopolizing the modern CPU virtualization technology of Intel and AMD processors, known as Intel-VT and AMD-V?".

It is a question many of us face at some point in our lives, as commonplace as "Did I add that 2nd dryer sheet to the laundry?" or, "Where does the evolutionary progression of mankind stand in relation to the macrocosm?"

The good news is that setting up a virtual machine is much simpler than you think! That's because this "modern" technology has actually been around for over a decade, there are just many out there who have not yet de-hermitted from their physical realm. And that's ok too.

A Kernel-based Virtual Machine, hereafter KVM is the infrastructure used to turn a Linux kernel into a hypervisor, also called a VMM (Virtual Machine Manager), to manage it.

@kalyco
kalyco / send() method rails
Last active August 29, 2015 14:24
short example of send() method in rails
class Car
def start
puts "vroom"
end
private
def engine_temp
puts "Just Right"
//For simple applications,, Ember Data's REST adapter can handle all
//asynchronous calls to the Rails server and completely insulate the
//dev from worrying about what happens when the server takes longer
//to respond than expected.
//If ever required to make a call to the server outside of a Route object's
//Model hook, you'll need to ensure that your application responds properly
//to when the call either fails or succeeds, and not to do anything about the
//call until it returns.
@kalyco
kalyco / rails JSON serializer for ember
Created June 9, 2015 19:24
Formatting rails data to a JSON through a serializer
# a rails controller set up to send user information to ember's profile page
class UsersController < Devise::SessionsController
def show
@user = User.find(params[:user_id])
respond_to do |format|
format.json { render json: @user }
end
end
end
@kalyco
kalyco / ember observe vs property method
Last active August 29, 2015 14:22
Data binding work is done by observers, that watch for changes, then fire off events (or updates data) when something happens. This change can be responded to in one of two ways.
// 1: Property method
App.NumberController = Ember.ObjectController.extend({
number: 1,
timesTwo: function() {
return Number(this.get('number')) * 2;
}.property('number')
});
// "property" lets you use the return value of a function as if it was a static value.
// if you add "property" to the end of your function and you can bind it to
// your template and display the value there.