Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focused

Clark Nelson clarknelson

🎯
Focused
View GitHub Profile
View gist:4c8ec378513356fb82a9
def test_hash_is_unordered
hash1 = { :one => "uno", :two => "dos" }
hash2 = { :two => "dos", :one => "uno" }
assert_equal false, hash1 == hash2
end
View gist:1ee58d6fb03e20763d40
36 in_ruby_version("mri") do
37 RubyConstant = "What is the sound of one hand clapping?"
38 def test_constants_become_symbols
39 all_symbols_as_strings = Symbol.all_symbols.map { |x| x.to_s }
40
41 assert_equal false, all_symbols_as_strings.include?(RubyConstant)
42 end
43 end
View gist:d6e85a16a35db142002b
9 class DiceSet
10 :attr_accessor :values
11 def roll(set)
12 @values = set
13 end
14 end
---
irb
---
View gist:9e6004874fb0fe12322f
$(window).scroll(function(){
var top = $(window).scrollTop();
var offset = 130;
var trigger = top+offset;
var elements = $('h1, h2, li');
checkElements(trigger, elements);
});
View gist:8a5beb9b1f1fa29d29b3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Bootstrap ROCKS!</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
View index.html
<div class="container">
<div class="slide one"></div>
<div class="slide two"></div>
<div class="slide three"></div>
<div class="slide four"></div>
</div>
View gist:5986972
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== CreateProducts: migrating =================================================
-- create_table(:products)
rake aborted!
An error has occurred, this and all later migrations canceled:
View gist:6786511
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *interpret_set(const char *input_set)
{
int counter;
int length = strlen(input_set);
char output[100];
for(counter = 0; counter<length; counter++){
View gist:6789140
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int charpos(const char character, const char *char_set)
{
int counter;
int length = strlen(char_set);
for (counter = 0; counter<length; counter++){
if (char_set[counter] == character){
View gist:6789419
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int charpos(const char character, const char *char_set)
{
int counter;
int length = strlen(char_set);
printf("%c\n", character);
for (counter = 0; counter<length; counter++){
You can’t perform that action at this time.