Skip to content

Instantly share code, notes, and snippets.

View justuseapen's full-sized avatar

Justus Eapen justuseapen

View GitHub Profile
@justuseapen
justuseapen / super-tip.txt
Created May 13, 2019 18:47 — forked from ericdouglas/super-tip.txt
Change 4 spaces to 2 spaces indentation and change tab to spaces - Vim tip
// 4 spaces to 2 spaces
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
// Tab to 2 spaces
:%s/\t/ /g
Ld /Users/Justus/Library/Developer/Xcode/DerivedData/Pavlok-fejopevgaomwoxbwcbejnzuunqgt/Build/Products/Debug-iphonesimulator/Pavlok.app/Pavlok normal x86_64
cd /Users/Justus/Dropbox/code/NorthOut-Dev
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -L/Users/Justus/Library/Developer/Xcode/DerivedData/Pavlok-fejopevgaomwoxbwcbejnzuunqgt/Build/Products/Debug-iphonesimulator -F/Users/Justus/Library/Developer/Xcode/DerivedData/Pavlok-fejopevgaomwoxbwcbejnzuunqgt/Build/Products/Debug-iphonesimulator -F/Users/Justus/Dropbox/code/NorthOut-Dev/Pavlok/Libraries -filelist /Users/Justus/Library/Devel
<head>
<title>...</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, target-densitydpi=medium-dpi, user-scalable=0" />
<link href="/assets/auth.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/courses.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/home.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/lessons.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" />
<script src="/assets/jquery.js?body=1"></script>
@justuseapen
justuseapen / ribbon.css
Created September 30, 2014 11:55
Random Ribbon
#ribbon {
width:100%;
height:100%;
position:fixed;
top:0;
left:0;
bottom:0;
right:0;
}
@justuseapen
justuseapen / gist:8c356ab0281ce28d04fe
Created September 30, 2014 00:18
Carbon Background CSS
background:
linear-gradient(27deg, #151515 5px, transparent 5px) 0 5px,
linear-gradient(207deg, #151515 5px, transparent 5px) 10px 0px,
linear-gradient(27deg, #222 5px, transparent 5px) 0px 10px,
linear-gradient(207deg, #222 5px, transparent 5px) 10px 5px,
linear-gradient(90deg, #1b1b1b 10px, transparent 10px),
linear-gradient(#1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424);
require 'benchmark'
#CHALLENGE:
#Please write a paragraph explaining what it does and how it works. Then, rewrite it so that it's
#beautiful and elegant and the intent is clear. Feel free to use any references or tools you would
#normally use.
def function(a)
a.inject({}){ |a,b| a[b] = a[b].to_i + 1; a}.reject{ |a,b| b == 1 }.keys
end
#create db:
createdb recipes
#create tables:
CREATE TABLE recipes (
id serial,
name varchar(255) NOT NULL,
yield int,
@justuseapen
justuseapen / Translator.rb
Created December 6, 2013 20:09
Pig latin translation 0.0.2
require 'pry'
class Translator
def initialize(word_or_phrase)
if word_or_phrase.split.length > 1
@phrase = word_or_phrase
elsif word_or_phrase.split.length == 1
@word = word_or_phrase
else
raise "You must input some words to be translated."
@justuseapen
justuseapen / home_purchase_option.rb
Created December 4, 2013 20:12
Mortgage Calculator
class HomePurchaseOption
def initialize(address,property_value,selling_price,down_payment)
@address = address
@property_value = property_value
@selling_price = selling_price
@down_payment = down_payment
end
def address
@address
require 'pry'
class PigLatinTranslation
def initialize(phrase)
@phrase = phrase
end
#provide the pig latin translation
def translate
new_phrase = []
words.each do |word|