Skip to content

Instantly share code, notes, and snippets.

View plusjade's full-sized avatar
🐵
🚀 🤖

Jade Dominguez plusjade

🐵
🚀 🤖
View GitHub Profile

We create an index with:

  • two filters: synonyms_expand and synonyms_contract
  • two analyzers: synonyms_expand and synonyms_contract
  • three text fields:
    • text_1 uses the synonyms_expand analyzer at index and search time
    • text_2 uses the synonyms_expand analyzer at index time, but the standard analyzer at search time
    • text_3 uses the synonyms_contract analyzer at index and search time

.

@plusjade
plusjade / gist:9928529
Created April 2, 2014 05:41
course Test
YO
@plusjade
plusjade / app.js
Last active August 29, 2015 14:03
NOTES: line marker-mid. usage of svg marker to place directional arrows on line (needs to be segmented)
// <marker id="direction-marker" viewBox="0 -5 10 10" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,-5L10,0L0,5"></path></marker>
function updateDirectionMarkers(linkData, namespace) {
var line = d3.svg.line()
.x(function(d) { return d.x; })
.y(function(d) { return d.y; });
var linkData = linkData.map(function(d) {
var midX = (d.source.x + d.target.x)/2;
var midY = (d.source.y + d.target.y)/2;
return [
@plusjade
plusjade / hi.js
Last active August 29, 2015 14:07
vanilla javascript to jquery counterparts.
// SELECT THE ELEMENT HAVING THE ID 'hello'
// vanilla
var element = document.getElementById('#hello');
// jquery:
var element = $("#hello");
// ---
// SELECT ALL body ELEMENTS
// vanilla
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<style>
h1 { color: red; }
</style>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'></script>
</head>
@plusjade
plusjade / main.js
Last active August 29, 2015 14:07
divided times lab
$(document).ready(function() {
// I don't like that the parent is being hidden so I'm going to unhide it.
$('#slide-down').show();
// all sections are childen of #slide-down so to start we should hide them all.
$('#slide-down section').hide();
function toggleSectionByName(name) {
// I need to know if any section is currently visible so I can
// quickly show another section rather than having the choppy affect of sliding it down.
<!doctype html>
<html>
<head>
<style>
body, html {
width: 100%;
margin: 0;
padding: 0;
}
#map {
var questions = [
"Two + Three",
"Five + Four",
"Nine - Two",
"Five - Three",
"Six + Three"
];
var answers = [
5, 9, 7, 2, 9
];

How engaged were you during the lesson?

  1. Not engaged at all.
  2. Mostly tuned out but there were a few interesting parts.
  3. Neutral. I was engaged but it had more to do with my effort than the actual lesson.
  4. Mostly engaged but I did tune out — it's hard to pay attention for so long!
  5. I was engaged the entire time.

How well did you understand this lesson's content?

<form>
<input name="item">
<button type="submit">Add Item</button>
</form>
<ul id="todo-items">
</ul>
<script id="item-template" type="text/x-template">
<li>
<span>{{ name }}</span>