Skip to content

Instantly share code, notes, and snippets.

View jpetto's full-sized avatar
🪐

Jonathan Petto (they/them) jpetto

🪐
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jpetto on github.
  • I am jpetto (https://keybase.io/jpetto) on keybase.
  • I have a public key ASAYfGgtiDCmyzB3UoE2C9nOKkMIHkfmuTeBHApk401xggo

To claim this, I am signing this object:

@jpetto
jpetto / l10n-keybindings.json
Last active October 20, 2017 15:43
VS Code keybindings for wrapping strings for L10n
{
"key": "cmd+shift+w",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "{{ _('${TM_SELECTED_TEXT}') }}"
}
},
{
"key": "cmd+shift+t",

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@jpetto
jpetto / post-checkout
Created May 4, 2016 14:56
Git post checkout hook for Python projects
#!/usr/bin/env python
import sys, os, re
from subprocess import check_output
prev_head = sys.argv[1]
new_head = sys.argv[2]
is_branch_checkout = sys.argv[3]
if is_branch_checkout == "0":
@jpetto
jpetto / desktop-base.html
Created April 13, 2016 15:44
Conditional content in an include
{% block site_footer %}
{% with new_links=True %}
{% include 'includes/site-footer.html' %}
{% endwith %}
{% endblock %}
@jpetto
jpetto / optimizely-review-checklist.md
Last active March 26, 2020 22:21
Checklist for reviewing & starting Optimizely experiments

Optimizely Review Checklist

Experiment

  • URL targeting
  • Variation redirects
  • Variation code
  • Audience
  • Traffic allocation
  • Goal(s)
@jpetto
jpetto / Header.js
Last active December 15, 2015 00:38
EWT Week 14 - React 2
import React from 'react';
let Header = React.createClass({
propTypes: {
'subtitle': React.PropTypes.string.isRequired
},
render: function() {
return (
<header className="app-header">
<h1>List-o-matic</h1>
@jpetto
jpetto / final-project-plan.md
Created November 30, 2015 01:34
EWTFA2015 - Final Project Plan sample

Final Project Plan

Carl Carlson

Overview

Being a huge fan of JavaScript, I'm going to research and become familiar with the Ember framework. I also want to be able to share my findings and code with other developers.

@jpetto
jpetto / ewt-element.html
Last active November 23, 2015 15:09
EWT FA 2015 - WK11: Polymer
<!-- Import polymer component as basic building block. -->
<link rel="import" href="bower_components/polymer/polymer.html">
<!-- Declare the custom element. -->
<dom-module id="ewt-element">
<!-- Create a template (no need for an id). -->
<template>
<style>
:host {
display: block;
@jpetto
jpetto / api.php
Created November 18, 2015 17:06
EWT FA2015 - Yahoo Weather API proxy
<?php
$results = array();
$search = (array_key_exists('search', $_REQUEST)) ? $_REQUEST['search'] : '';
if ($search) :
$BASE_URL = "http://query.yahooapis.com/v1/public/yql";
$yql_query = 'select * from weather.forecast where woeid in (select woeid from geo.places(1) where text="' . $search . '")';
$yql_query_url = $BASE_URL . "?q=" . urlencode($yql_query) . "&format=json";
// Make call with cURL
$session = curl_init($yql_query_url);