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
Param([string]$clsid, [string]$templateFile) | |
# Refer Windows Runtime | |
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] > $null | |
[Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null | |
# Read toast template XML | |
$template = Get-Content $templateFile | |
$xml = New-Object Windows.Data.Xml.Dom.XmlDocument | |
$xml.LoadXml($template) |
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 numba | |
@numba.njit | |
def shifting_fill(src, dst): | |
"""Fill a 2D (or more multi-demensional) array-like object by shifting a 1D array, using NUMBA. | |
This is useful when making an input to a RNN from time series data, that is, where | |
src = [0, 2, 1, 3, 5] | |
and the number of time steps fed in the RNN is M=3, | |
dst = [ |
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
#!/usr/bin/env/python | |
""" This sends a notification to LINE via LINE notify API. | |
:param str token: API token | |
:param *: messages | |
""" | |
import sys |
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
# Define search function because pygithub does not support /search/commits API yet. | |
import github | |
def __Github_search_commits(self, word, sort=github.GithubObject.NotSet, order=github.GithubObject.NotSet, **kwargs): | |
""" | |
:calls: `GET /search/commit` | |
:param str word: string search keyword | |
:param str sort: string ('author-date', 'commiter-date') (default: best match) | |
:param str order: string ('desc', 'asc') (default: 'desc') | |
:param dict kwargs: dictionary including query parameter set | |
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Commit` |
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
# Logger settings | |
from logging import getLogger, StreamHandler, DEBUG | |
logger = getLogger(__name__) | |
handler = StreamHandler() | |
handler.setLevel(DEBUG) | |
logger.setLevel(DEBUG) | |
logger.addHandler(handler) | |
logger.propagate = False | |
import logging |
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
def line_notify(token, msg): | |
""" Post a notification to LINE. | |
:param str token: access token for LINE Notify | |
:param str msg: notifier message | |
""" | |
import requests | |
api = 'https://notify-api.line.me/api/notify' | |
payload = {'message': msg} |