Skip to content

Instantly share code, notes, and snippets.

View askedrelic's full-sized avatar

Matt Behrens askedrelic

View GitHub Profile
@askedrelic
askedrelic / gist:4597730
Last active August 15, 2017 07:49
Timezones array
TIMEZONES = [
('Pacific/Pago_Pago', "-11:00 - Samoa, Midway Island"),
('America/Adak', "-10:00 - Aleutian Islands"),
('Pacific/Honolulu', "-10:00 - Hawaii"),
('Pacific/Marquesas', "-09:30 - Marquesas Islands"),
('Pacific/Gambier', "-09:00 - Gambier Islands"),
('America/Anchorage', "-09:00 - Alaska"),
('America/Los_Angeles', "-08:00 - US Pacific Time (US & Canada)"),
('Pacific/Pitcairn', "-08:00 - Pitcairn Islands"),
('America/Phoenix', "-07:00 - Arizona Mountain Standard Time"),
@askedrelic
askedrelic / gist:4651871
Created January 28, 2013 01:05
top 20 most watched github repos across all languages
import requests
import re
popular_repos = []
lang_page = requests.get('https://github.com/languages')
popular_langs = list(set(re.findall('href="/languages/(.*?)"', lang_page.content)))
for lang in popular_langs:
most_watched_lang_page = requests.get('https://github.com/languages/{0}/most_watched'.format(lang))
import requests
import base64
# requires pygithub library
from github import Github
g = Github(username, password)
repo_readmes = {}
for repo_name in uniq_popular_repos:
Repo README name README Filetype README Bytesize
elasticsearch/elasticsearch README.textile textile 7935
NancyFx/Nancy readme.md md 5483
timburks/cocoa-programming-with-nu README readme 432
mathjax/MathJax-dev README.txt txt 2018
forthnutter/6805 README readme 491
petdance/ack README.markdown markdown 1178
nulldesign/nd2d README.md md 9100
hercules-team/augeas README readme 3519
johnmyleswhite/ML_for_Hackers README.md md 1054
# -*- encoding: utf-8 -*-
"""
django-thumbs by Antonio Melé
http://django.es
"""
from django.db.models import ImageField
from django.db.models.fields.files import ImageFieldFile
from PIL import Image
from django.core.files.base import ContentFile
import cStringIO
#!/bin/sh
security find-generic-password -a "$1" -g 2>&1 | grep password | sed -e "s/password: \"//" -e "s/\"//"
@askedrelic
askedrelic / todo.js
Created August 15, 2017 08:13
Simple React TODO app #react
<script type="text/babel">
var SAMPLE_DATA = [
{"unread": false, "desc": "Hey, I just wanted to check in with you from Toronto. I got here earlier today.", "name": "Tilo Mitra", "avatar": "http://api.twitter.com/1/users/profile_image?screen_name=tilomitra&amp;size=bigger", "subject": "Hello from Toronto", "timestamp": "3:56pm, April 3, 2012", "content": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."},
{"unread": true, "desc": "Hey, I had some feedback for pull request #51. We should center the menu so it looks better on mobile.", "name": "Eric Ferraiuolo", "avatar": "http://api.twitter.com/1/users/profile_image?screen_name=yuilibrary&amp;size=bigger", "subject": "Re: Pull Requests", "timestamp": "2:27pm, April 3, 2012", "content": "Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat null
@askedrelic
askedrelic / dates.py
Last active November 22, 2020 19:41
Python formatted dates #python
import arrow
dates = [arrow.now().replace(days=x).format('YYYY-MM-DD') for x in range(90)]
for x in dates: print x
@askedrelic
askedrelic / ruby-help.sh
Created August 15, 2017 08:15
Ruby gems help
# install Gemfile
bundle
bundle lock
gem install
# uninstall all unnecesary gems
gem cleanup