Skip to content

Instantly share code, notes, and snippets.

{
"blog": [{
"2017": [{
"title": "A New Hope",
"slug": "a-new-hope",
"date": "1977-05-25",
"tags": ["Gary Kurtz, Rick McCallum"],
"categories": [""],
"description": "Princess Leia is captured and held hostage by the evil Imperial forces in their effort to take over the galactic Empire. Venturesome Luke Skywalker and dashing captain Han Solo team together with the loveable robot duo R2-D2 and C-3PO to rescue the beautiful princess and restore peace and justice in the Empire.",
"publish": true
{
"blog": [{
"2017": [{
"title": "A New Hope",
"slug": "a-new-hope",
"date": "1977-05-25",
"tags": ["Gary Kurtz, Rick McCallum"],
"categories": [""],
"description": "Princess Leia is captured and held hostage by the evil Imperial forces in their effort to take over the galactic Empire. Venturesome Luke Skywalker and dashing captain Han Solo team together with the loveable robot duo R2-D2 and C-3PO to rescue the beautiful princess and restore peace and justice in the Empire.",
"publish": true
@gpavey
gpavey / two-way-data-bind.html
Created November 9, 2017 13:39
2 way data binding with jquery
<div style="border: 1px solid pink; padding: 10px;" bind="any_name">This div's content
will be replaced when you edit the input below</div>
<input type="text" placeholder="First input with same bind value" bind="any_name"/>
<input type="text" placeholder="Second input with same bind value" bind="any_name"/>
@gpavey
gpavey / 2_keyboard_shortcuts.md
Last active May 23, 2016 19:56
Here are some things you can do with Gists in GistBox.

Create documentation for your projects. Like so:


Most popular keyboard shortcuts within GistBox

  • Up/Down - Previous/Next Gist
  • Ctrl+e - Edit a selected Gist
  • Ctrl+s - Save Gist
@gpavey
gpavey / YouTube AJAX API
Last active August 17, 2016 15:18
API I wrote that will pull YouTube channels and present them in a slider.
$(document).ready(function() {
$('#hero').html('<iframe name="videoFrame" width="560" height="315" src="http://www.youtube.com/embed?listType=playlist&list=PLHx5HChsMcasTeHm7oaCt0HCB8ci4I4NS&controls=0&showinfo=0" theme="" modestbranding="1" rel="0" frameborder="0"allowfullscreen=""></iframe>');
$('.tabs nav ul li a:first').on('click', function(e){
e.preventDefault();
$('.tabs nav ul li').removeClass('tab-current');
$(this).parent('li').addClass('tab-current');
$('#hero').html('<iframe name="videoFrame" width="560" height="315" src="http://www.youtube.com/embed?listType=playlist&list=PLHx5HChsMcasTeHm7oaCt0HCB8ci4I4NS&controls=0&showinfo=0&modestbranding=1&theme=" rel="0" frameborder="0" allowfullscreen=""></iframe>');
@gpavey
gpavey / Ajax Example
Last active August 29, 2015 14:04
Example of using Ajax to recreate hacker-news
$(document).ready(function() {
$('.vote-button').on('click', upVote)
$('.delete').on('click', deletePost)
$('form').on('submit', formSubmit );
}); // End Document Ready
function upVote(e){
e.preventDefault();
var url = e.target.pathname;
@gpavey
gpavey / jquery_example.html
Created March 12, 2014 20:55 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<!-- Add a link to jQuery CDN here script here -->
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
@gpavey
gpavey / jquery_example.html
Last active August 29, 2015 13:57 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<!-- Add a link to jQuery CDN here script here -->
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
@gpavey
gpavey / 0.2.1-boggle_class_from_methods.rb
Last active August 29, 2015 13:55 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1boggle class challenge
class BoggleBoard
attr_reader :dice_grid
def initialize(dice_grid)
@dice_grid = dice_grid
end
def create_word(*coords)
p coords.map {|coord| @dice_grid[coord.first][coord.last]}.join("")
end