Skip to content

Instantly share code, notes, and snippets.

View donigian's full-sized avatar

armen donigian donigian

  • Jet Propulsion Labratory
  • Pasadena
View GitHub Profile
@donigian
donigian / ShardIndexRecord.scala
Created July 12, 2015 04:21
ShardIndexRecord
/* Purpose of ShardIndexRecord is to store/correlate connectionString for a particular shardId.
This allows one to find database server connection specific to a given shard */
case class ShardIndexRecord(shardId: String, connectionString: String, status: Boolean, createdDate: Long)
@donigian
donigian / redshift
Created July 1, 2015 14:39
RedShift
Setup Database
create database [db-name];
revoke all on schema public from public;
create schema [schema-name];
create table [schema-name].[table-name](
...
)
@donigian
donigian / User.rb
Created June 10, 2015 06:13
Ruby Class
class User
attr_accessor :name, :email
def initialize(attributes = {})
@name = attributes[:name]
@email = attributes[:email]
end
def formatted_email
"#{@name} <#{@email}>"
end
@donigian
donigian / benchmark_ruby_block.rb
Created June 9, 2015 07:37
Ruby Benchmark Howto
require "benchmark"
def calculation_with_explicit_block_passing(a, b, operation)
operation.call(a, b)
end
def calculation_with_implicit_block_passing(a, b)
yield(a, b)
end
@donigian
donigian / gist:631b9b038b890a5e881f
Created June 8, 2015 06:33
Ruby: How to Create & Distribute a Gem: This file consists of a few lines of Ruby code that instantiate a Gem::Specification object and populate it with information about your program.
# babalu.gemspec
spec = Gem::Specification.new do |spec|
spec.name = 'babalu'
spec.summary = 'A library for doing things for babalu'
spec.description = %{This library calculates a bunch of cool things.}
spec.author = 'A D'
spec.email = 'doni at gmail.com'
spec.homepage = 'http://www.cnn.com/'
spec.files = Dir['lib/*.rb']
spec.version = '1.0.0'
@donigian
donigian / gist:cc2450219e5c92901390
Last active March 29, 2016 19:23
Vagrant Cheat Sheet
Vagrant Cheat Sheet
Essential Commands
vagrant up - Starts your virtual machine.
vagrant status - Tells you if your virtual machine is running.
vagrant suspend - Saves the state of your virtual machine. (Similar to putting it to sleep.)
vagrant resume - Restores a suspended virtual machine. (Similar to waking it up from sleep.)
After your first vagrant up, a suspend/resume operation only takes a few seconds.
Destroying your virtual machine means that you'll need to wait through the ~20 minute boostrap process the next time that you vagrant up.
@donigian
donigian / gist:4784fb7c72b6d8e18bab
Created March 31, 2015 07:04
scala days android app error
> run
[info] Updating {file:/Users/armendonigian/funcode/scala-days-android/}scala-days-android...
[info] Resolving com.crashlytics.android#crashlytics;1.+ ...
[error] Unable to find credentials for [Artifactory Realm @ repo.typesafe.com].
[error] Unable to find credentials for [Artifactory Realm @ repo.typesafe.com].
[info] Resolving jline#jline;2.12 ...
[info] Done updating.
[info] Unpacking aar: macroid_2.11-2.0.0-M3.aar to org.macroid-macroid_2.11-2.0.0-M3
[info] Unpacking aar: appcompat-v7-21.0.3.aar to com.android.support-appcompat-v7-21.0.3
[info] Unpacking aar: support-v4-21.0.3.aar to com.android.support-support-v4-21.0.3
@donigian
donigian / keybase.md
Created December 17, 2014 22:55
keybase.md

Keybase proof

I hereby claim:

  • I am donigian on github.
  • I am babalu (https://keybase.io/babalu) on keybase.
  • I have a public key whose fingerprint is 9CDD FD8F 219C BE06 080D F8B1 5240 F568 A92B 7A04

To claim this, I am signing this object:

@donigian
donigian / designer.html
Last active August 29, 2015 14:09
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
@donigian
donigian / gist:035938d2d9835fba7531
Created October 21, 2014 16:58
standard logback.xml
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy MM dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="warn">
<appender-ref ref="STDOUT" />
</root>