This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import xlsxwriter | |
| # Create workbook with a new worksheet. | |
| workbook = xlsxwriter.Workbook('hello.xlsx') | |
| worksheet = workbook.add_worksheet() | |
| # Write the tokens. | |
| worksheet.write('A1', 'Hello') | |
| worksheet.write('B1', 'world') | |
| worksheet.write('C1', '!') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2019-present, Thomas Wolf. | |
| # All rights reserved. This source code is licensed under the MIT-style license. | |
| """ A very small and self-contained gist to train a GPT-2 transformer model on wikitext-103 """ | |
| import os | |
| from collections import namedtuple | |
| from tqdm import tqdm | |
| import torch | |
| import torch.nn as nn | |
| from torch.utils.data import DataLoader | |
| from ignite.engine import Engine, Events |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys, os, time | |
| import tweepy | |
| keys = dict( | |
| consumer_key='_YOUR_CONSUMER_KEY', | |
| consumer_secret='_YOUR_SECRET_KEY', | |
| access_token='_YOUR_ACCESS_TOKEN', | |
| access_token_secret='_YOUR_ACCESS_TOKEN_SECRET' | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cols <- c("Conservative" = "#0087DC", "Labour" = "#DC241f", "Liberal" = "#ffd700", "Whig" = "#FF7F00","Peelite"="#99FF99","Tory"="#b2b2ff","In Office"="black") | |
| mydate <- as.Date("1900-01-01", "%Y-%m-%d") | |
| explain <- as.Date("1864-01-01", "%Y-%m-%d") | |
| Walpole <- as.Date("1676-04-01", "%Y-%m-%d") | |
| bute <- as.Date("1713-01-01", "%Y-%m-%d") | |
| Grenville <- as.Date("1712-10-14", "%Y-%m-%d") | |
| Elder <-as.Date("1708-11-15", "%Y-%m-%d") | |
| North <-as.Date("1732-04-13", "%Y-%m-%d") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Download a podcast episode from anchor.fm | |
| # | |
| # Usage: | |
| # grab-anchor-episode "https://anchor.fm/emerge/episodes/Robert-MacNaughton---Learnings-from-the-Life-and-Death-of-the-Integral-Center-e31val" # (m4a example) | |
| # grab-anchor-episode "https://anchor.fm/free-chapel/episodes/Are-You-Still-In-Love-With-Praise--Pastor-Jentezen-Franklin-e19u4i8" # (mp3 example) | |
| # | |
| # anchor.fm serves a list of m4a or mp3 files that need to be concatenated with ffmpeg. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Implementation of [SSLSocketFactory] that adds [TlsVersion.TLS_1_2] as an enabled protocol for every [SSLSocket] | |
| * created by [delegate]. | |
| * | |
| * [See this discussion for more details.](https://github.com/square/okhttp/issues/2372#issuecomment-244807676) | |
| * | |
| * @see SSLSocket | |
| * @see SSLSocketFactory | |
| */ | |
| class Tls12SocketFactory(private val delegate: SSLSocketFactory) : SSLSocketFactory() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Author: HJ van Veen <[email protected]> | |
| # Description: Experiment to learn a tSNE transformer for new | |
| # test data with a multi-output GBM | |
| # | |
| # Idea first seen at lvdmaaten.github.io/tsne | |
| # > [...] it is not possible to embed test points in an existing | |
| # > map [...] | |
| # > A potential approach to deal with this would be to train | |
| # > a multivariate regressor to predict the map location from | |
| # > the input data. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| import time | |
| import json | |
| import requests | |
| from requests_oauthlib import OAuth1 | |
| MEDIA_ENDPOINT_URL = 'https://upload.twitter.com/1.1/media/upload.json' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- index.html 2017-03-08 20:16:55.078748101 +0100 | |
| +++ index_modified.html 2017-03-08 20:17:07.752111989 +0100 | |
| @@ -1,12 +1,12 @@ | |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| -<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
| -<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script> | |
| +<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
| +<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script> |