Skip to content

Instantly share code, notes, and snippets.

View garethpaul's full-sized avatar
:octocat:

Gareth Paul Jones (GPJ) garethpaul

:octocat:
View GitHub Profile
// FoursquareSearch.swift
// This file was generated from JSON Schema using quicktype, do not modify it directly.
// To parse the JSON, add this file to your project and do:
//
// let foursquareSearch = try? newJSONDecoder().decode(FoursquareSearch.self, from: jsonData)
import Foundation
// MARK: - FoursquareSearch
@garethpaul
garethpaul / index.html
Created June 6, 2018 21:24
LIDAR Data SF
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.41.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.41.0/mapbox-gl.css' rel='stylesheet' />
<style>
@garethpaul
garethpaul / cellinfo
Created September 6, 2017 03:39
GeoLocate
public static JSONArray getCellInfo(Context ctx){
TelephonyManager tel = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
JSONArray cellList = new JSONArray();
// Type of the network
int phoneTypeInt = tel.getPhoneType();
String phoneType = null;
phoneType = phoneTypeInt == TelephonyManager.PHONE_TYPE_GSM ? "gsm" : phoneType;
phoneType = phoneTypeInt == TelephonyManager.PHONE_TYPE_CDMA ? "cdma" : phoneType;
@garethpaul
garethpaul / 4sq_categories-emoji.swift
Created October 5, 2016 17:15 — forked from rkotzy/4sq_categories-emoji.swift
Trying to map all the Foursquare categories (https://developer.foursquare.com/categorytree) to emojis ✌️
let categories = [
"56aa371be4b08b9a8d5734db":"🎶", // Amphitheaters
"4fceea171983d5d06c3e9823":"🐠", // Aquariums
"4bf58dd8d48988d1e1931735":"🎮", // Arcades
"4bf58dd8d48988d1e2931735":"🖼", // Art Galleries
"4bf58dd8d48988d1e4931735":"🎳", // Bowling Alleys
"4bf58dd8d48988d17c941735":"🎰", // Casinos
"52e81612bcbc57f1066b79e7":"🎪", // Circuses
"4bf58dd8d48988d18e941735":"😂", // Comedy Clubs
"5032792091d4c4b30a586d5c":"🎶", // Concert Halls
@garethpaul
garethpaul / gnip.py
Created February 5, 2016 22:10
GNIP
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__="Scott Hendrickson, Josh Montague"
import sys
import requests
import json
import codecs
import datetime
import time
Development Phase:
Step 1: Create Certificate .pem from Certificate .p12
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
Step 2: Create Key .pem from Key .p12
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
Step 3: Optional (If you want to remove pass phrase asked in second step)
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
@garethpaul
garethpaul / ton_api.py
Created January 6, 2016 03:18
TonAPI Helper
import ConfigParser
import urllib
import random
import base64
import hmac
import binascii
import time
import collections
import hashlib
import requests
import ConfigParser
import urllib
import random
import base64
import hmac
import binascii
import time
import collections
import hashlib
import requests
@garethpaul
garethpaul / it_listener.py
Created December 8, 2015 05:41
iot_listener.py
from scapy.all import *
import tweepy
# Make constants to hold values of our keys
CONSUMER_KEY = "xxxxxx"
CONSUMER_SECRET = "xxxx"
ACCESS_TOKEN = "xxxx"
ACCESS_SECRET = "xxxx"
MAIN_USER = "gpj"
@garethpaul
garethpaul / arp_probe.py
Last active December 8, 2015 05:40
arp_probe.py
from scapy.all import *
def arp_display(pkt):
if pkt[ARP].op == 1: #who-has (request)
print "Request from " + pkt[ARP].hwsrc
print sniff(prn=arp_display, filter="arp", store=0, count=0)