Skip to content

Instantly share code, notes, and snippets.

View kierarad's full-sized avatar

Kiera Radman kierarad

View GitHub Profile
@kierarad
kierarad / prompt.md
Last active September 19, 2019 23:33
GoCD usability test prompt
  1. Create an empty directory (you can name it my-repo)
    mkdir my-repo
  2. cd into it
    cd my-repo
  3. Initialize the directory
    git init
  4. Make a commit (an empty one is fine)
    git commit --allow-empty -m "first commit"
  5. Copy the path to the directory
environments:
default:
pipelines:
- repo2-pipeline
pipelines:
repo2-pipeline:
group: POC
materials:
foo-pipeline:
pipeline: Build-Test
---
format_version: 3
environments:
internal:
pipelines:
- gocd-trial-launcher
- gocd-trial-installers
pipelines:
gocd-trial-launcher:
group: go-cd-contrib
$(document).ready(function() {
$('#roller button.add').on('click', function() {
console.log("WAT")
$('.dice').append('<div class="die">0</div>');
});
$('#roller button.roll').on('click', function() {
$('.die').each(function(k, die) {
var value = Math.floor((Math.random()*6)+1);
$(die).text(value);
A few things to note about AJAX and JQuery with Rails:
1- Rails ships with CoffeeScript (see coffeescript.org)
2- Jquery is officially bundled with the Rails (jquery-rails gem)
3- Rails uses Unobtrusive JavaScript (jquery_ujs library)
Unobtrusive JavaScript? What's that?
- ujs is a way to seperate your HTML, and CSS from your Javascript
So how do we do that? Here is an example of obtrusive javascript:
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
@kierarad
kierarad / ajax date button
Created October 3, 2013 22:16
AJAX example
function displayGetResults(x){
$("#container").replaceWith(x);
};
function getNextDay(event) {
event.preventDefault();
var link = $("#nextDayLink").attr("href")+'/content';
$.get(link, displayGetResults);
};
@kierarad
kierarad / gist:6532987
Created September 12, 2013 04:14
repository url for active_record challenge
https://github.com/kierarad/ar-student-schema
class Computer_Board
attr_reader :board
def initialize
@ships = [%w[A A A A A], %w[B B B B], %w[C C C], %w[D D], %w[D D], %w[S S], %w[S S]]
@board = Array.new(10) {Array.new(10,'/')}
@mvmt = [ [-1, 0], #top
[0, 1], #right

##Initializing a new repo Type in what comes AFTER the $...do not type in the $

BASIC git initialization and repo creation:

$ git init

This command creates an empty git repository - basically a .git directory with subdirectories for objects, refs/heads, refs/tags, and template files. An initial HEAD file that references the HEAD of the master branch is also created.