Skip to content

Instantly share code, notes, and snippets.

View karapigeon's full-sized avatar

Pigeon karapigeon

View GitHub Profile
---
# Welcome to the playbook for Valora CI using BuildKite and Mac Stadium.
# This defines the tools and dependencies needed to test Valora and Ansible installs them.
# It is a work in progress!
# Install Homebrew and then casks and packages.
- name: Install Homebrew, casks and packages.
hosts: localhost
become: false
---
- name: Install Brew packages
hosts: localhost
become: false
vars:
brew_cask_packages:
- homebrew/cask-versions/adoptopenjdk8
- android-sdk
- android-platform-tools
- genymotion
find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
@karapigeon
karapigeon / slash-command.rs
Created August 28, 2020 19:24
Slack Slash Command Hello World in Rust using Rocket.
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use] extern crate rocket;
use rocket::request::Form;
#[derive(FromForm)]
pub struct Parameters {
// Payload fields from "Preparing your app to receive Commands" section in documentation:
// https://api.slack.com/interactivity/slash-commands#app_command_handling.
pub token: String,
@karapigeon
karapigeon / file.swift
Created July 18, 2020 01:01
realm clear
try! FileManager.default.removeItem(at:Realm.Configuration.defaultConfiguration.fileURL!)
@karapigeon
karapigeon / guessing_game.rs
Created July 19, 2019 19:04
Guessing Game example from The Rust Programming Language book.
extern crate rand;
use std::io;
use std::cmp::Ordering;
use rand::Rng;
fn main() {
println!("Guess the number!");
let secret_number = rand::thread_rng().gen_range(1, 101);
//
// Checkin.swift
// Created by Luna Graysen on 2019-05-01.
// Copyright © 2019 Luna Graysen. All rights reserved.
//
import Foundation
struct Checkin {
insertCheckboxFormField(pageRect, pageNo, type) {
let instance = this.PSPDF;
async function createNewFormField(instance) {
try {
const formFieldName = type + "_formfield";
const newFormFieldName = `${formFieldName}_${Math.random()
.toString(36)
.replace(/[^a-z]+/g, "")}`;
const toolbarItems = PSPDFKit.defaultToolbarItems;
let pagerIndex = toolbarItems.findIndex(item => item.type == "pager");
toolbarItems.splice(pagerIndex - 1, 0, {
type: "custom",
title: "click me",
onPress: function() {
console.log("click");
}
});