Skip to content

Instantly share code, notes, and snippets.

View tomfbush's full-sized avatar
🏠
Working from home

Tom Bush tomfbush

🏠
Working from home
View GitHub Profile
@devStepsize
devStepsize / slack_slash_cmd.py
Created April 21, 2016 23:12
Server-side logic to handle a Slack slash command using Python and Flask
'''
This is an example of the server-side logic to handle slash commands in
Python with Flask.
Detailed documentation of Slack slash commands:
https://api.slack.com/slash-commands
Slash commands style guide:
https://medium.com/slack-developer-blog/slash-commands-style-guide-4e91272aa43a#.6zmti394c
'''
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 6 columns, instead of 4. in line 8.
datasetName,about,link,categoryName,cloud,vintage
Microbiome Project,American Gut (Microbiome Project),https://github.com/biocore/American-Gut,Biology,GitHub,NA
GloBI,Global Biotic Interactions (GloBI),https://github.com/jhpoelen/eol-globi-data/wiki#accessing-species-interaction-data,Biology,GitHub,NA
Global Climate,Global Climate Data Since 1929,http://en.tutiempo.net/climate,Climate/Weather,,1929
CommonCraw 2012,3.5B Web Pages from CommonCraw 2012,http://www.bigdatanews.com/profiles/blogs/big-data-set-3-5-billion-web-pages-made-available-for-all-of-us,Computer Networks,,2012
Indiana Webclicks,53.5B Web clicks of 100K users in Indiana Univ.,http://cnets.indiana.edu/groups/nan/webtraffic/click-dataset/,Computer Networks,,NA
Criteo click-through,Criteo click-through data,http://labs.criteo.com/2015/03/criteo-releases-its-new-dataset/,Computer Networks,,NA
ICWSM 2009,ICWSM Data Challenge (since 2009),http://icwsm.cs.umbc.edu/,Data Challenges,,2009
KDD Cup,KDD Cup by Tencent 2012,http://www.kddcup2012.org/,Data
@tanaikech
tanaikech / submit.md
Created September 7, 2017 03:55
Uploading Image Files to Slack Using Incoming Webhooks by Google Apps Script

Uploading Image Files to Slack Using Incoming Webhooks by Google Apps Script

This sample script is for uploading image files to Slack using Incoming Webhooks by Google Apps Script.

When users try to upload image files to Slack using Incoming Webhooks, it has been known that although the access token is required to directly upload them, Incoming Webhooks can upload them by using the tag of image_url. In this sample script, it uploads image files (BMP, GIF, JPEG and PNG) on Google Drive to Slack using Incoming Webhooks. The script is written by Google Apps Script.

In this sample, It supposes that there are image files on Google Drive.

Script :

@gajeshbhat
gajeshbhat / strToInt.py
Last active October 31, 2023 19:41
Convert k to Integer thousand Python.
def convert_str_to_number(x):
total_stars = 0
num_map = {'K':1000, 'M':1000000, 'B':1000000000}
if x.isdigit():
total_stars = int(x)
else:
if len(x) > 1:
total_stars = float(x[:-1]) * num_map.get(x[-1].upper(), 1)
return int(total_stars)
@wiso
wiso / covariance_to_correlation.py
Created March 20, 2018 08:33
Compute correlation matrix from covariance matrix using numpy
import numpy as np
def correlation_from_covariance(covariance):
v = np.sqrt(np.diag(covariance))
outer_v = np.outer(v, v)
correlation = covariance / outer_v
correlation[covariance == 0] = 0
return correlation
@endolith
endolith / DFT_ANN.py
Last active June 12, 2024 18:25
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np
import matplotlib.pyplot as plt
N = 32
batch = 10000
@abhishekkrthakur
abhishekkrthakur / slack_notifier.py
Created December 6, 2019 07:53
Slack notification from python
import os
import requests
import json
SLACK_WEBHOOK= os.environ.get("SLACK_WEBHOOK")
def send_message(messages, channel="abhishek", username="beast"):
"""
:param messages: list of texts