Skip to content

Instantly share code, notes, and snippets.

🤖 I have created a release beep boop

iam: 0.2.0

0.2.0 (2022-09-30)

Features

@chingor13
chingor13 / gist:8bcdaf992020d89d0c404a3bbbbeff9a
Created March 9, 2021 22:19
commits-with-pull-requests.json
{
"data": {
"repository": {
"ref": {
"target": {
"history": {
"nodes": [
{
"associatedPullRequests": {
"nodes": [
@chingor13
chingor13 / blueprint.yaml
Last active January 4, 2021 06:52
Recent Motion Blueprint
blueprint:
name: Recent Motion
description: Track recent motion as a state
domain: automation
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
@chingor13
chingor13 / convert.php
Last active June 18, 2018 23:20
Testing base conversion
<?php
// $foo = "12524176338753030162";
// $foo = "12524176338";
$foo = $argv[1];
function bcdechex($dec) {
$hex = '';
do {
$last = bcmod($dec, 16);
@chingor13
chingor13 / app.yaml
Created January 12, 2018 18:57
gRPC memory leak sample application for GAE flexible environment
env: flex
service: protobuf
runtime: php
manual_scaling:
instances: 1
runtime_config:
document_root: web
@chingor13
chingor13 / README.md
Created October 11, 2017 20:55
Use AstKit extension to look at the AST from a given PHP file.

Usage

  • install AstKit extension (requires PHP 7.0+)

    $ pecl install astkit
  • enable AstKit for PHP

@chingor13
chingor13 / my_app
Last active August 29, 2015 14:11
Demo unicorn and nginx config for workshop
# This needs to be zzz_amos because the default site must be loaded last otherwise
# We'll end up with the default site being highest priority in routing.
server {
# Set as default fall back site.
server_name _;
listen 80 default_server;
root /srv/my_app/my_app/public;
index index.html;
@chingor13
chingor13 / bulk_fetcher.rb
Created June 17, 2014 20:05
Bulk fetching
# This is an in-memory cache that can do bulk fetches (via find)
# You can queue up ids to fetch at a later time.
class BulkFetcher
def initialize
reset!
end
def queue(klass, ids)
@queue[klass] += Array(ids)
@chingor13
chingor13 / gist:5624726
Created May 22, 2013 02:00
Cheating RTanque
class KageBunshin < RTanque::Bot::Brain
NAME = 'kage_bunshin'
include RTanque::Bot::BrainHelper
def tick!
hide_from_sensors!
pick_spot!
turn_to_spot!
acquire_target!
@chingor13
chingor13 / gist:5624572
Last active December 17, 2015 14:29
RTanque
class TooMuchCode < RTanque::Bot::Brain
NAME = 'too_much_code'
include RTanque::Bot::BrainHelper
def tick!
@game_mode ||= :one_on_one
game_mode_detect!
damage_detection!
if game_mode_known?