Skip to content

Instantly share code, notes, and snippets.

@yxlao
yxlao / start_dropbox_daemon.py
Last active October 21, 2017 07:25
Dropbox Automatic Sync
import os
import socket
import time
import argparse
import updown
import logging
# Usage:
# 1.
# pip install dropbox
@yxlao
yxlao / tf_conv_gradients.py
Last active April 27, 2022 09:27
TensorFlow Convolution Gradients
"""
Demostrating how to compute the gradients for convolution with:
tf.nn.conv2d
tf.nn.conv2d_backprop_input
tf.nn.conv2d_backprop_filter
tf.nn.conv2d_transpose
This is the scripts for this answer: https://stackoverflow.com/a/44350789/1255535
"""
@yxlao
yxlao / google_search_bs.py
Last active January 18, 2019 15:54
Google search with BeautifulSoup
import requests
from bs4 import BeautifulSoup
search_url_prefix = "https://www.google.com/search?q="
def get_first_result(search_str):
search_url = search_url_prefix + search_str
r = requests.get(search_url)
soup = BeautifulSoup(r.text, "html.parser")
return soup.find('cite').text
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->