Skip to content

Instantly share code, notes, and snippets.

View rtanglao's full-sized avatar
😃
you rock :-)

Roland Tanglao rtanglao

😃
you rock :-)
View GitHub Profile
@eyeseast
eyeseast / python.md
Last active May 6, 2024 17:11
How to set up Python in 2022

I have an updated version of this on my blog here: https://chrisamico.com/blog/2023-01-14/python-setup/.

Python

This is my recommended Python setup, as of Fall 2022. The Python landscape can be a confusing mess of overlapping tools that sometimes don't work well together. This is an effort to standardize our approach and environments.

Tools and helpful links:

  • Python docs: https://docs.python.org/3/
  • Python Standard Library:  - Start here when you're trying to solve a specific problem
from github import Github
import os
g = Github(os.getenv("GITHUB_TOKEN"))
u = g.get_user("....")
for repo in u.get_repos():
print(repo.html_url)
value = input("Delete y/n?")
if value.lower() == "y":
print("Deleting: {}".format(repo.html_url))
We can't make this file beautiful and searchable because it's too large.
Location,Crash Type,Municipality,Year,Crash Count,Latitude,Longitude
GRANDVIEW HWY S & TEMPLETON DR,Property damage only,VANCOUVER,2017,1,49.25909,-123.060191
BOUNDARY RD & REGENT ST,Property damage only,VANCOUVER,2017,1,49.259109,-123.023633
VINE ST & W 14TH AVE,Property damage only,VANCOUVER,2017,1,49.259265,-123.157816
E 13TH AVE & WATSON ST,Property damage only,VANCOUVER,2017,1,49.259302,-123.100497
ASH ST & W 13TH AVE,Property damage only,VANCOUVER,2017,3,49.259493,-123.117658
MACDONALD ST & W 14TH AVE,Property damage only,VANCOUVER,2017,3,49.259579,-123.168318
BALACLAVA ST & W 14TH AVE,Property damage only,VANCOUVER,2017,1,49.259663,-123.174155
FIR ST & W 13TH AVE,Property damage only,VANCOUVER,2017,1,49.259853,-123.141183
E 12TH AVE & KINGSWAY & MILLTOWN PL,Property damage only,VANCOUVER,2017,44,49.259878,-123.096571
#!/usr/bin/env python3
import requests
from requests.compat import urljoin
AS_TOKEN = "redacted"
HS_BASE = "https://darkfasel.net"
ROOMS = [
"!someroomid:darkfasel.net"
]
@brianleroux
brianleroux / upgrade-vim.sh
Created April 18, 2019 23:17
upgrade vim on os x from scratch
git clone https://github.com/vim/vim.git
cd vim/src
./configure --enable-multibyte --enable-terminal --enable-gui=no --without-x
make
sudo make install
@jtleek
jtleek / nhanes-flexdashboard.Rmd
Created March 13, 2019 17:50
Example interactive app in R
---
title: "How does your BMI measure up?"
output: flexdashboard::flex_dashboard
runtime: shiny
---
Inputs {.sidebar}
-------------------------------------
```{r}

Install Mongo with WSL for Windows.

Home

This doc will guide you through installing Mongo DB using WSL through the Command Line.

Most of the steps are listed out here, but this guide will trim them down and make it more straight forward for our needs. There is also 1 step that is not in the link above as well, which will be noted when we come across it.

Install MongoDB Community Edition.

  1. Follow the directions listed on the mongodb official website for your distro of choice.
@anttilipp
anttilipp / temperatureCircle.py
Created August 2, 2017 21:50
Code to reproduce the "Temperature Circle" visualization.
#
# Hi all,
# this is the Python code I used to make the visualization "Temperature circle"
# (https://twitter.com/anttilip/status/892318734244884480).
# Please be aware that originally I wrote this for my tests only so the
# code was not ment to be published and is a mess and has no comments.
# Feel free to improve, modify, do whatever you want with it. If you decide
# to use the code, make an improved version of it, or it is useful for you
# in some another way I would be happy to know about it. You can contact me
# for example in Twitter (@anttilip). Unchecked demo data (no quarantees)
@yrashk
yrashk / osstoken.md
Last active February 10, 2022 04:04
OSS Token

Open Source Software Token[s]

The idea behind this is to research and experiment with "smart contract" funding for open source and free software.

  • Allow less-known developers / projects to earn the public's trust ("cautious funding" — helping them build a reputation of being able to deliver; mechanisms may vary. could be based on bounties [see below] or funds release confirmations if bounties are not suitable for any reason... or something else entirely)
  • Allow direct organization/person funding (simple token transfer)
  • Allow funding specific goals (bounties)
  • Allow branding [sub]tokens for a specific project (bragging, voting, other kinds of rights)
  • Allow continuous support pledges (recurring payments)
  • Allow nominees to exchange tokens for the amount they were originally bought for (backed by ETH, the funding is deposited through an ICO, or a series of offerings)
@johnboxall
johnboxall / slack-cleanup.js
Last active February 2, 2017 06:17
Archive Slack channels with no messages in the last three months.
// Archive channels with no new messages in the last two months.
// Usage: npm install slack async
// SLACK_TOKEN=XYZ node slack-cleanup.js
// Get your Slack Token: https://api.slack.com/docs/oauth-test-tokens
"use strict"
const readline = require('readline')
const slack = require('slack')
const async = require('async')