Skip to content

Instantly share code, notes, and snippets.

@zznq
zznq / Ugly Conditions
Created September 28, 2011 17:25
Ugly Nested Conditions
if (!$desc.is(':visible')) {
if(quick)
$desc.show();
else
$desc.slideDown();
} else {
if(quick)
$desc.hide();
else
$desc.slideUp();
@zznq
zznq / SImpler
Created September 28, 2011 17:45 — forked from brandonc/SImpler
Ugly Nested Conditions
$desc.has(':visible')[(quick ? 'hide' : 'slideUp')]();
$desc.has(':hidden')[(quick ? 'show' : 'slidedown')]();
require 'zeus/rails'
class CustomPlan < Zeus::Rails
def test
RSpec.configuration.seed = rand 1..10_000
exit RSpec::Core::Runner.run(ARGV)
end
def after_fork
$program-colors: 'teal' #008e8d,
'yellow' #e6c01e,
'green' #00bb66,
'blue' #0071ba,
'teal' #0b667c,
'magenta' #cc0066,
'light-blue' #0091ed,
'red' #e93e1d;
.program {
@zznq
zznq / _details.mustache
Created January 8, 2014 20:50
Some code snippets to help guide in using mustache templates for both client side rendering and server side rendering(in rails)
<section class="{{type}}>
<p>{{body}}</p>
{{#some_partial}}
</section>
@zznq
zznq / 1000.text
Created November 4, 2016 19:04
Generates n number of primes using sieve of eratosthenes. https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
1 -> 2 2 -> 3 3 -> 5 4 -> 7 5 -> 11
6 -> 13 7 -> 17 8 -> 19 9 -> 23 10 -> 29
11 -> 31 12 -> 37 13 -> 41 14 -> 43 15 -> 47
16 -> 53 17 -> 59 18 -> 61 19 -> 67 20 -> 71
21 -> 73 22 -> 79 23 -> 83 24 -> 89 25 -> 97
26 -> 101 27 -> 103 28 -> 107 29 -> 109 30 -> 113
31 -> 127 32 -> 131 33 -> 137 34 -> 139 35 -> 149
36 -> 151 37 -> 157 38 -> 163 39 -> 167 40 -> 173
41 -> 179 42 -> 181 43 -> 191 44 -> 193 45 -> 197
46 -> 199 47 -> 211 48 -> 223 49 -> 227 50 -> 229
@zznq
zznq / README.md
Last active November 4, 2016 19:06