Skip to content

Instantly share code, notes, and snippets.

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

nick3499 nick3499

🏠
Working from home
  • USA
View GitHub Profile
@nick3499
nick3499 / nil_empty_blank_present_ffdierence_in_ruby
Last active May 29, 2018 04:56 — forked from pythonicrubyist/nil_empty_blank_present_ffdierence_in_ruby
Difference between nil?, empty?, blank? and present? in Ruby and Ruby on Rasils.
# nil? can be used on any Ruby object. It returns true only if the object is nil.
nil.nil? # => true
[].nil? # => false
{}.nil? # => false
"".nil? # => false
" ".nil? # => false
true.nil? # => false
# empty? can be used on some Ruby objects including Arrays, Hashes and Strings. It returns true only if the object's length is zero.
nil.empty? # NoMethodError: undefined method `empty?' for nil:NilClass
@nick3499
nick3499 / fizzbuzz_for_loop.js
Last active April 26, 2018 00:06 — forked from AJ-Acevedo/fizzbuzz_for_loop.js
JavaScript - Fizz Buzz
function fizzBuzz(n) {
for (var i = 1; i <= n; i++) {
var fb = '';
if (i % 15 == 0) {
fb = 'FizzBuzz';
}
else if (i % 3 == 0) {
fb = 'Fizz';
}
else if (i % 5 == 0) {
@nick3499
nick3499 / index.html
Last active March 23, 2018 03:16 — forked from d3byex/index.html
D3byEX 9.10: Symbols (Adapted to D3.js v5)
<!DOCTYPE html>
<html><meta charset=utf-8>
<head>
<meta name="description" content="D3.js v5, built-in symbol array" />
</head>
<body>
<script src="http://d3js.org/d3.v5.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script>
<script>
@nick3499
nick3499 / index.html
Last active March 10, 2017 07:45 — forked from d3byex/index.html
D3byEX 9.9: Ring Graph (Adapted to D3.js v4)
<!DOCTYPE html>
<html><meta charset=utf-8>
<head>
<meta name="description" content="D3.js v4, svg, pie, arc" />
</head>
<body>
<script src="http://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script>
<script>
@nick3499
nick3499 / index.html
Last active March 10, 2017 01:50 — forked from d3byex/index.html
D3byEX 9.7: Pie (Adapted to D3.js v4)
<!DOCTYPE html>
<html><meta charset=utf-8>
<head>
<meta name="description" content="D3.js v4, arc, pie" />
</head>
<body>
<script src="http://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script>
<script>
@nick3499
nick3499 / index.html
Last active March 9, 2017 21:04 — forked from d3byex/index.html
D3byEX 9.6: Donut Segment (Adapted to D3.js v4)
<!DOCTYPE html>
<html><meta charset=utf-8>
<head>
<meta name="description" content="D3.js v4, arc, donut segment, d3.arc" />
</head>
<body>
<script src="http://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script>
<script>
@nick3499
nick3499 / index.html
Last active March 9, 2017 19:05 — forked from d3byex/index.html
D3byEX 9.4: Donut (Adapted to D3.js v4)
<!DOCTYPE html>
<html><meta charset=utf-8>
<head>
<meta name="description" content="D3.js v4, arc, circle, donut" />
</head>
<body>
<script src="http://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script>
@nick3499
nick3499 / index.html
Last active March 9, 2017 08:23 — forked from d3byex/index.html
D3byEX 9.3: Arc Generator (Adapted to D3.js v4)
<!DOCTYPE html><html><meta charset=utf-8>
<head>
<meta name="description" content="D3.js, SVG arc circle" />
</head>
<body>
<script src="http://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script>
<script>
@nick3499
nick3499 / index.html
Last active March 9, 2017 02:52 — forked from d3byex/index.html
D3byEX 9.2: Area Generator (Adapted to D3.js v4)
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<head>
<meta name="description" content="D3.js v4, line graph area" />
</head>
<body>
<script src="http://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script>
<script>
@nick3499
nick3499 / index.html
Last active March 8, 2017 23:06 — forked from d3byex/index.html
D3byEX 9.1: Line Generator (Adapted to D3.js v4)
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<head>
<meta name="description" content="D3.js v4, line sequence, SVG
container" />
</head>
<body>
<script src="http://d3js.org/d3.v4.min.js"></script>