Skip to content

Instantly share code, notes, and snippets.

View JohnMorales's full-sized avatar

John Morales JohnMorales

  • Northern Virginia
View GitHub Profile
@JohnMorales
JohnMorales / zlorpian
Created October 19, 2013 12:46 — forked from bokmann/zlorpian
Good afternoon fellow space travelers, thanks for coming along on this mission. We still have about a week
before we arrive at New Zlorpia, so please return your stasis tubes to their original upright position and
prepare for your mission briefing.
We are going to be negotiating a trade agreement with the Zlorpians for their supply of Farkle seeds. They
have a much different way of counting than we do, and I'm concerned that if we don't have a good way to
work with their number system, we'll be at a disadvantage in negotiations. Let me explain:
The zlorpians have a single arm that comes out of their forehead, with a hand that has 3 fingers. As a
result, our base-10 way of counting (based on our ten fingers) is as alien to them as their way is to us.
require './zlorpian'
# Good afternoon fellow space travelers, thanks for coming along on this mission. We still have about a week
# before we arrive at New Zlorpia, so please return your stasis tubes to their original upright position and
# prepare for your mission briefing.
# We are going to be negotiating a trade agreement with the Zlorpians for their supply of Farkle seeds. They
# have a much different way of counting than we do, and I'm concerned that if we don't have a good way to
# work with their number system, we'll be at a disadvantage in negotiations. Let me explain:
class MyClass
def foo
end
end
class MyClass
def self.how_many_objects?
@number_of_objects
end
def self.record_new_object
@number_of_objects = (@number_of_objects||0).next
end
def initialize
self.class.record_new_object #since it’s a class instance, ‘number_of_objects’ not accesible via the object instance initialize method.
class MyClass
@@number_of_objects = 0
def self.how_many_objects?
@@number_of_objects
end
def initialize
@@number_of_objects = @@number_of_objects.next # 'number_of_objects' asscesible to object instances of the class. (i.e. initialize is an instance method..)
end
def foo
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDR8YMkpSbC0EZKapJ59w1XfTs2/3sHnOPHGxeFIAneHaK1ZsbvH4DX5dbo2+OKSpukmdPAyW0iZuLpLr5tXNHuUzTQ57w8eEqlhVTx/u8l9AUWn+SazR/GDZ4Yzo+UAQrJhus6SwpHZLfjHwVqq3I3J4fdq0MzPNwFdOXI8n3KIA8stL6Z3jxlDvPjPncTNbb/evupf+0QmYH+OhlbQWAAhIHdtwRSnysDNquENn1khrl9zQyAWPhEsxUnHS3zYNVGkOw/RgGfBl07HzCzcPkR/Se0oW1heTOX2A/6qvgBAweCqfS5fHSAXaRRHnozrncgdZHAajcWYkaw3nR0VT+7 johnmorales@new-host-9.home
@JohnMorales
JohnMorales / TrueColor.md
Last active August 29, 2015 14:26 — forked from XVilka/TrueColour.md
True Color (16 million colors) support in various terminal applications and terminals

Colors in terminal

It's a common confusion about terminal colors... Actually we have this:

  • plain ascii
  • ansi escape codes (16 color codes with bold/italic and background)
  • 256 color palette (216 colors + 16 gray + ansi) (colors are 24bit)
  • 24bit true color ("888" colors (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
#! /bin/sh
if test -z "${REAL_OPT_DIR}"; then
# next line to be replaced according to OPTWARE_TARGET
REAL_OPT_DIR=/volume1/@optware
fi
case "$1" in
start)
echo "Starting Optware."
//https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#multipletrackers
ga('create', 'UA-54906935-2', 'auto', {'name': 'lifefuelsTracker'});
ga('require', 'ec');
ga('ec:setAction', 'purchase', {
'id': 'SET_TRANS_ID_HERE', // (Required) Transaction id (string).
'revenue': 'SET_TOTAL_HERE', // Revenue (currency).
'coupon': 'SET_COUPON_HERE' // Transaction coupon (string).
});
ga('lifefuelsTracker.send', 'event', 'preorders', 'completed purchase');