Skip to content

Instantly share code, notes, and snippets.

# Copyright: Public domain.
# Filename: INFLIGHT_ALIGNMENT_ROUTINES.agc
# Purpose: Part of the source code for Luminary 1A build 099.
# It is part of the source code for the Lunar Module's (LM)
# Apollo Guidance Computer (AGC), for Apollo 11.
# Assembler: yaYUL
# Contact: Ron Burkey <info@sandroid.org>.
# Website: www.ibiblio.org/apollo.
# Pages: 1249-1258
# Mod history: 2009-05-26 RSB Adapted from the corresponding
# Copyright: Public domain.
# Filename: CONTROLLED_CONSTANTS.agc
# Purpose: Part of the source code for Luminary 1A build 099.
# It is part of the source code for the Lunar Module's (LM)
# Apollo Guidance Computer (AGC), for Apollo 11.
#
# Assembler: yaYUL
# Contact: Jim Lawton <jim.lawton@gmail.com>
# Website: www.ibiblio.org/apollo.
# Pages: 038-053
@weallwegot
weallwegot / azlyrics_webscrape.py
Last active November 10, 2018 22:26
Scraping Az Lyrics For All Artists Songs
"""
managedkaos/azlyrics.py
https://gist.github.com/managedkaos/e3262b80154129cc9a976ee6ee943da3
"""
# Requests is a library that allows you to programmatically send out http requests
import requests
# os is a library for doing operating system things, like looking through file directories
import os
import time
@weallwegot
weallwegot / top_x_occurrences.py
Created November 10, 2018 09:20
Function to determine the top 10 occurrences of a particular metric
get_top_x_occurrences('curse_used',curses,10)
get_top_x_occurrences('laugh_used',laughs,10)
get_top_x_occurrences('link_used',links,10)
def get_top_x_occurrences(special_key,list_of_dicts,occurrence_number):
"""
function to find the top occurrences of a given instance
for instance top x emojis
top x curse words
top x laughing expressions
@weallwegot
weallwegot / double_text_calc.py
Last active November 10, 2018 08:28
A scaled down implementation of calculating double texts occurrences.
PARTICPANT_1 = "Me"
PARTICPANT_2 = "Friend"
time_diffs_s1 = []
time_diffs_s2 = []
#tes is a list of TextEquivalent objects
for i in range(len(tes)):
earlier_te = tes[i]
# because calculations require 2 Text Equivalents simulataneously
if i < len(tes)-1:
later_te = tes[i+1]
@weallwegot
weallwegot / unicode_regex.py
Last active August 22, 2018 12:52
Detecting emoji presence in raw text with regular expressions.
import re
all_text = "💁🏾💁🏾💁🏾💁 🤗 😩😩😩"
txt_utf_8 = all_text.decode('utf-8')
re.findall(ur'(\ud838[\udc50-\udfff])|([\ud839-\ud83d][\udc00-\udfff])|\
(\ud83e[\udc00-\udfbf])|([\udc50-\udfff]\ud838)|\
([\udc00-\udfff][\ud839-\ud83d])|([\udc00-\udfbf]\ud83e)'\
,txt_utf_8)
@weallwegot
weallwegot / emoji_dictionary_unicode.py
Last active August 22, 2018 11:36
A key/value mapping of emoji unicode values to plain text english descriptions.
emoji_d_code_keys = {
'U+1F4B9': u'chart increasing with yen',
u'U+1F471 U+1F3FF U+200D U+2642 U+FE0F': u'blond-haired man: dark skin tone',
u'U+2602': u'umbrella',
u'U+2603': u'snowman',
u'U+2600': u'sun',
u'U+2601': u'cloud',
u'U+1F469 U+1F3FF U+200D U+2708 U+FE0F': u'woman pilot: dark skin tone',
u'U+1F937 U+1F3FE U+200D U+2640 U+FE0F': u'woman shrugging: medium-dark skin tone',
u'U+1F487 U+1F3FB U+200D U+2640 U+FE0F': u'woman getting haircut: light skin tone',
@weallwegot
weallwegot / read_parse.py
Last active August 25, 2018 18:06
Read and parse a text message conversation text file.
import re
from src.convo_objects.TextEquivalent import TextEquivalent
def read_and_parse_text_file(full_ass_path, block_text_threshold_seconds):
"""
:param full_ass_path: path to the file where the text data is
:full_ass_path type: str
:param block_text_threshold_seconds: number of seconds between sequential texts for
them to be considered as "one" text. they will be merged. see `merge_sequential_text_equiv()`
@weallwegot
weallwegot / TextEquivalent.py
Last active November 10, 2018 07:16
Represents a text message object, or a series of texts sent in quick succession.
class TextEquivalent(object):
def __init__(self,name,timestamp_string,text):
self.sender = name
self.time = None
self.all_text = text
self.timestamp = timestamp_string
self.date_day_of_week = self.timestamp.isoweekday()
self.date_year = self.timestamp.year
self.date_month = self.timestamp.month
self.date_day = self.timestamp.day
@weallwegot
weallwegot / HOWTO.md
Last active January 9, 2018 00:00 — forked from kylefrost/HOWTO.md
How-To: Tweet All Commit Messages

Creating the post-commit file

Note: If you want to use your personal Twitter account to post commits, go to Step 2

  1. Create a new Twitter account for your commit messages. Example
  2. Go to https://apps.twitter.com and Sign In with your Twitter account you are posting commit messages to.
  3. Hover over your username in the top-right corner after signing in and select "My Applications"
  4. Create a new application
  5. The name, description, and site can all be whatever you want, but leave Callback URL empty
  6. Under "Application Settings" click "modify app permissions" next to "Access level"