Skip to content

Instantly share code, notes, and snippets.

@edgarborja
edgarborja / insert_spawns.sql
Last active October 17, 2016 15:56
Insert new pokemon based on historical data
INSERT INTO pokemon (encounter_id,spawnpoint_id,pokemon_id,latitude,longitude,disappear_time)
SELECT
UUID(), spawnpoint_id, 132, latitude, longitude, --generates a random encounter ID
CONCAT(DATE_FORMAT(DATE_ADD(now(), INTERVAL 15 MINUTE),'%Y-%m-%d %H:'), dt_min, ':' , dt_sec) AS dt
FROM
(SELECT spawnpoint_id, latitude, longitude,
CAST(min(dt_min) AS CHAR(2)) AS dt_min , CAST(min(dt_sec) AS CHAR(2)) AS dt_sec
FROM pokespawns WHERE
dt_min = DATE_FORMAT(DATE_ADD(now(), INTERVAL 14 MINUTE), '%i')
AND total > 1
@edgarborja
edgarborja / create_spawns.sql
Last active October 15, 2016 17:26
Create a spawns table
CREATE TABLE pokespawns (
SELECT spawnpoint_id, latitude, longitude, dt_min, dt_sec, count(*) AS total
FROM
(SELECT spawnpoint_id, latitude, longitude,
DATE_FORMAT(disappear_time, '%i') AS dt_min,
DATE_FORMAT(disappear_time, '%s') AS dt_sec
FROM pokemon
WHERE disappear_time > '2016-10-06' --there was a big change in spawn locations, older spawns are useless
) spawns
GROUP BY
@jplusc
jplusc / GAME_MASTER_v0_1.protobuf
Created July 21, 2016 16:25 — forked from anonymous/GAME_MASTER_v0_1.protobuf
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
anonymous
anonymous / GAME_MASTER_v0_1.protobuf
Created July 16, 2016 16:31
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@anointed
anointed / multi-ipn.php
Created September 30, 2012 02:42
Paypal multiple IPN's
<?php
/*
* This is a PayPal IPN (Instant Payment Notification) broadcaster
* Since PayPal does not provide any straightforward way to add
* multiple IPN listeners we'll have to create a central IPN
* listener that will broadcast (or filter and dispatch) Instant
* Payment Notifications to different destinations (IPN listeners)
*
* http://codeseekah.com/2012/02/11/how-to-setup-multiple-ipn-receivers-in-paypal/
*