Skip to content

Instantly share code, notes, and snippets.

View EdwardTang's full-sized avatar
🌴
On Crushing Agentic AI

Eddie Tang EdwardTang

🌴
On Crushing Agentic AI
  • Good Night Oppie LLC
  • Seattle
  • 08:12 (UTC -12:00)
View GitHub Profile
@Snarp
Snarp / google-docs-copy.js
Last active September 24, 2025 05:14
Script to allow copying from a protected Google Doc
/*
<https://stackoverflow.com/questions/40296831/is-it-possible-to-force-a-copy-of-a-protected-google-doc>
NOTE - 2021-05-24
-----------------
The script below isn't the fastest way to copy-and-paste from a protected
Google Doc. Before trying it, I'd suggest following MikoFrosty's advice from
the comments:
@softwarebandit
softwarebandit / .bash_profile
Created May 19, 2016 14:29
Adding git status to your shell prompt in OSX
# Download a copy of git-prompt.sh from https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
# and add the code below to your .bash_profile
#custom terminal prompt with git support:
source ~/.git-prompt.sh
export PROMPT_COMMAND="__git_ps1 '\w' ' \$ '"
export GIT_PS1_SHOWCOLORHINTS=1
export GIT_PS1_SHOWDIRTYSTATE=1
@artjomb
artjomb / infiniteScroll_1.py
Last active June 12, 2023 00:00
infinite scroll of stackstatus with python in phantomjs
import selenium
import time
from selenium import webdriver
browser = webdriver.PhantomJS("phantomjs")
browser.get("https://twitter.com/StackStatus")
print browser.title
pause = 3
import re
import random
import base64
from scrapy import log
class RandomProxy(object):
def __init__(self, settings):
self.proxy_list = settings.get('PROXY_LIST')
fin = open(self.proxy_list)
@stephenyeargin
stephenyeargin / remote-control-dashing.md
Last active April 27, 2017 11:41
Using Dashing with Hubot to control which dashboard is being shown.

Remotely control your Dashing Dashboard

The problem

We have a dashboard at the office that displays some internal company metrics so everyone can be up to speed on them. However, when we have guests, we have to either SSH into the Raspberry Pi or simply turn off the television. This seems clumsy, and we can do better than that.

The solution

Dashing works by adding event listeners in Javascript and updating the associated widgets. We're going to hijack this process to build a simple redirect that can accept a posted value and send the dashboard to another screen.

@daspecster
daspecster / update-python-ec2.sh
Last active March 22, 2016 06:27
Update EC2 Python virtualenv
# Thanks to Sebastian Kreutzberger
# Source: http://www.lecloud.net/post/61401763496/install-update-to-python-2-7-and-latest-pip-on-ec2
# install build tools
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y
# install python 2.7 and change default python symlink
sudo yum install python27-devel -y
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
# coding: utf-8
require 'mechanize'
require 'nokogiri'
require 'json'
m = Mechanize.new
m.user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.16 Safari/537.36'
@jaganadhg
jaganadhg / CLINICAL_NLP_RES
Last active September 5, 2017 00:44
Clinical NLP Resources
http://emerge.mc.vanderbilt.edu/natural-language-processing-nlp-survey-tools-resources
https://wiki.nci.nih.gov/display/VKC/cTAKES+1.2.2+Developer+Install+Instructions
https://www.i2b2.org/software/projects/hitex/hitex_manual.html
http://www.dbmi.pitt.edu/blulab
http://knowledgemap.mc.vanderbilt.edu/research/content/medex-tool-finding-medication-information
https://code.google.com/p/medex-uima/
http://knowledgemap.mc.vanderbilt.edu/research/content/sectag-tagging-clinical-note-section-headers
http://loinc.org/downloads
http://www.jbiomedsem.com/content/4/1/1
http://www.comp.leeds.ac.uk/scsh/papers/i2b2Paper.pdf
@raineorshine
raineorshine / java-exception-handling-best-practices.md
Last active May 19, 2024 10:57
5 Great Resources for Exception Handling Best Practices in Java

General Tip

"The trick is to catch exceptions at the proper layer, where your program can either meaningfully recover from the exception and continue without causing further errors, or provide the user with specific information, including instructions on how to recover from the error. When it is not practical for a method to do either of these, simply let the exception go so it can be caught later on and handled at the appropriate level."

Resources

Advantages of Exceptions
Excellent example of separating error-handling code from program logic

Three Rules for Effective Exception Handling
Longer explanation and case study of exception use, including the basic principles of "throw early" and "catch late". Clear and thorough.

@lovevn
lovevn / gist:4324998
Created December 18, 2012 04:24
Good deal crawler Get from http://pastebin.com/QNFyu4sa
# -*- coding: utf-8 -*-
# Competitor Intelligence Agent
# License: Creative Commons CC BY-NC-SA
#
# By Michael Gradek, a proud Udacian
# Twitter: @MichaelGradek
#
# Competitor Intelligence Agent aims to collect and display a report with relevant information about Groupon.es, one of the largest Collective Buying sites in Spain (... and in the world!)
# For more information about Collective Buying please refer to: http://en.wikipedia.org/wiki/Group_buying