Skip to content

Instantly share code, notes, and snippets.

View andkon's full-sized avatar
🤠

Andrew Konoff andkon

🤠
View GitHub Profile
@andkon
andkon / archive.py
Last active March 5, 2021 19:37
Archive all posts on instagram
from instagram_private_api import Client, ClientCompatPatch
from instagram_private_api.errors import ClientError
username = ""
password = ""
api = Client(username, password) # have to disable 2fa
posts = []
user_feed = api.user_feed(api.authenticated_user_id, max_id="")
posts.extend(user_feed['items'])
@andkon
andkon / blewatcher.ino
Created December 31, 2018 04:46
Using a Redbear Duo to watch and store the last 100 BLE addresses.
#include <Adafruit_NeoPixel.h>
/*
* Defaultly disabled. More details: https://docs.particle.io/reference/firmware/photon/#system-thread
*/
//SYSTEM_THREAD(ENABLED);
/*
* SYSTEM_MODE:
* - AUTOMATIC: Automatically try to connect to Wi-Fi and the Particle Cloud and handle the cloud messages.
import requests
from pytz import timezone
from datetime import datetime
from twilio.rest import Client
import json
import os
import sys
def login():
# cURL login
@andkon
andkon / statusblinker.py
Created April 25, 2018 22:29
Site Status Blink1 Script
from blink1.blink1 import Blink1
import requests
import time
"""
I run this with a bash script, `something.sh`, which just runs it, and which will catch any errors that it can then email to me:
python3.6 statusblinker.py
"""
b1 = Blink1()
"""
Figure out how wide/tall the square is, and what the bottomright-most number is
Figure out how far from any corner your number is
Figure out how many layers deep the middle is
"""
import math
def third(number):
""" Returns the number of steps between number and 1 in that weird data table structure. """
# The spreadsheet consists of rows of apparently-random numbers.
# To make sure the recovery process is on the right track, they need you to calculate the spreadsheet's checksum.
# For each row, determine the difference between the largest value and the smallest value; the checksum is the sum of all of these differences.
# For example, given the following spreadsheet:
# 5 1 9 5
# 7 5 3
# 2 4 6 8
# The first row's largest and smallest values are 9 and 1, and their difference is 8.
# The second row's largest and smallest values are 7 and 3, and their difference is 4.
# The third row's difference is 6.
"""
ADVENT OF CODE 1 2017
The captcha requires you to review a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list.
The list is circular, so the digit after the last digit is the first digit in the list.
For example:
1122 produces a sum of 3 (1 + 2) because the first digit (1) matches the second digit and the third digit (2) matches the fourth digit.
1111 produces 4 because each digit (all 1) matches the next.
1234 produces 0 because no digit matches the next.

Keybase proof

I hereby claim:

  • I am andkon on github.
  • I am andk (https://keybase.io/andk) on keybase.
  • I have a public key ASDXBI1_LgIJDDFvttIMU5JghaFXYBKLAMnJ2ZUSJoTyawo

To claim this, I am signing this object:

Objective C:
NSLog(@"404 Error: Page not found");
Swift:
print("404 Error: Page not found")
Android:
Log.v("404 Error: Page not found")
React Native:
@andkon
andkon / index.js
Created January 17, 2017 18:06
Realm Mobile Platform PE — wit.ai NLP event handling demo
'use strict';
var fs = require('fs');
var Realm = require('realm');
const {Wit, log} = require('node-wit');
// Insert the Realm admin token
// Linux: `cat /etc/realm/admin_token.base64`