Skip to content

Instantly share code, notes, and snippets.

View rafinskipg's full-sized avatar
🏠
Working from home

Venture rafinskipg

🏠
Working from home
  • web3
  • Worldwide
View GitHub Profile
class Calculator {
add = () => {
// Empty method
}
}
describe("Calculator", function() {
var calculator;
beforeEach(function() {
calculator = new Calculator();
});
it("should have an add method", function() {
expect(calculator.add).toBeDefined()
});
});
class Calculator {
// This is an empty class
}
const MAX_DEVIATION_SUPPORTED = 0.35
function average(items) {
const total = items.reduce((prev, next) => {
return prev + next
}, 0)
return total / items.length
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
import { Injectable } from '@angular/core'
import { CanDeactivate, Router } from '@angular/router'
import { Observable } from 'rxjs/Observable'
import 'rxjs/add/operator/delay'
@Injectable()
export class DelayDeactivate implements CanDeactivate<Observable<boolean>> {
constructor(private router: Router) {}
canDeactivate() {
@rafinskipg
rafinskipg / controller.js
Created June 10, 2015 13:21
Angular JS Shortcut Directive
/** ... **/
$scope.save = function(){
}
$scope.delete = function(){
}

Keybase proof

I hereby claim:

  • I am rafinskipg on github.
  • I am rafinskipg (https://keybase.io/rafinskipg) on keybase.
  • I have a public key whose fingerprint is 1409 C26F 75BD 52F5 8198 EC75 7494 B82B 5831 1B2C

To claim this, I am signing this object:

@rafinskipg
rafinskipg / git-branch-log.sh
Created December 16, 2014 11:37
git-branch-log
# Show the logs of a local branch
#
# An alternative option could be (with caveats): git log --walk-reflogs $1
#
# See: http://stackoverflow.com/questions/14848274/git-log-to-get-commits-only-for-a-specific-branch
git log $1 --not $(git for-each-ref --format='%(refname)' refs/heads/ | grep -v "refs/heads/$1")
@rafinskipg
rafinskipg / prefix.js
Created December 10, 2014 00:23
Add prefix
var word = "poop";
function getPrefix(word){
var vowels = ['a','e','i','o','u'];
return vowels.indexOf(word.charAt(0)) != -1 ? 'an' : 'A';
}
console.log(getPrefix(word) + ' ' + word);