Skip to content

Instantly share code, notes, and snippets.

@bokenator
bokenator / post-receive.sh
Last active March 3, 2016 22:35
git PT integration
#!/usr/bin/env bash
# post-receive
# Get config variables
api_token=$(git config --get hooks.pivotal-tracker.api-token)
pid=$(git config --get hooks.pivotal-tracker.project-id)
branch=$(git config --get hooks.pivotal-tracker.integration-branch)
mark_accepted () {
curl --silent -X PUT -H "X-TrackerToken: $api_token" -H "Content-Type: application/json" -d '{"current_state": "accepted"}' "https://www.pivotaltracker.com/services/v5/projects/$pid/stories/$1" > /dev/null
<link rel="import" href="/lib/polymer/polymer.html">
<link rel="import" href="/lib/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="/elements/onion-app/onion-app.html">
<link rel="import" href="/lib/iron-icons/iron-icons.html">
<link rel="import" href="/lib/iron-icons/hardware-icons.html">
<link rel="import" href="/elements/bootstrap-dropdown/bootstrap-dropdown.html">
<dom-module id="onion-rgbled">
<style>
:host {

Introduction

  • Intro to the Onion Cloud
  • Using the SDK
    • What it can teach you
    • What you will be able to accomplish with it
  • Using the Sandbox

Guide

/*
To use this script, do the following:
1. log in to https://ais.usvisa-info.com
2. Click on the "Continue" button to go to the actions page
3. Open up Console on your browser
4. Copy and paste this script into the console and press Enter to run the script
*/
'use strict';
use crate::common::{ get_input };
pub async fn part1() -> i32 {
let input = get_input("https://adventofcode.com/2022/day/1/input").await
.split("\n")
.collect::<Vec<&str>>().iter()
.map(|v| v.parse::<i32>().or::<i32>(Ok(0)).unwrap())
.collect::<Vec<i32>>();
let grouped_input = {
use crate::common::get_input;
use std::{cmp::Ordering, iter};
fn directed_range(a: i32, b: i32) -> impl Iterator<Item = i32> {
let mut start = a;
let end = b;
iter::from_fn(move || match start.cmp(&end) {
Ordering::Less => {
start += 1;
use crate::common::get_input;
use std::collections::{BTreeMap, VecDeque};
type Point = (usize, usize);
fn get_index(character: char) -> usize {
match character {
'S' => 0,
'E' => 25,
character => "abcdefghijklmnopqrstuvwxyz"