Skip to content

Instantly share code, notes, and snippets.

View yasunori's full-sized avatar

yasunori yasunori

View GitHub Profile
@yasunori
yasunori / start.sh
Created March 25, 2022 05:56
Kinesis Video Streams Producer SDK Gstreamer Plugin sample script for Raspberry pi 4 + Ubuntu20.04
export LD_LIBRARY_PATH=/opt/awssdk/amazon-kinesis-video-streams-producer-sdk-cpp/build/downloads/local/lib:$LD_LIBRARY_PATH
export PATH=/opt/awssdk/amazon-kinesis-video-streams-producer-sdk-cpp/build/downloads/local/bin:$PATH
export GST_PLUGIN_PATH=/opt/awssdk/amazon-kinesis-video-streams-producer-sdk-cpp/build:$GST_PLUGIN_PATH
# kinesis-video-producer-test のアクセスキー
export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
export AWS_DEFAULT_REGION=ap-northeast-1
STREAM_NAME=stream-test
{
"settingsVersion": "1.67",
"exclusionRules": [
{
"pattern": "https?://mail.google.com/*",
"passKeys": "jkuxogai"
},
{
"pattern": "https?://cacoo.com/*",
"passKeys": ""
@yasunori
yasunori / traceback.py
Created June 2, 2021 06:46
traceback.py
import traceback
import logger
logger.error(traceback.format_exc())
class Creative(BaseModel):
"""
TEST
"""
FOLDER_NAME = "creatives"
class StatusCd(models.TextChoices):
BEFORE_REVIEWING = 'BR', '審査前'
REVIEWING = 'RE', '審査中'
AFTER_REVIEWING = 'AR', '審査終了'
import smtplib
import email.utils
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
SENDER = ''
SENDERNAME = 'testman'
RECIPIENT = '' # to mail address
REPLY_TO = ''
RUN ckan-pip install --no-cache-dir git+https://github.com/alphagov/ckanext-s3-resources#egg=ckanext-s3-resources && \
ckan-pip install --no-cache-dir -r https://raw.githubusercontent.com/alphagov/ckanext-s3-resources/master/requirements.txt
$ ->
$(".editable_number").keydown (e) ->
code = e.keyCode
if (code >= 48 && code <= 57) or (code >= 96 && code <= 105) or (code == 8)
return true
else if code == 13
next_id = next_editable($(this).attr('id'))
$("#" + next_id).focus()
return false
else
@next_editable = (id) ->
first = null
target = null
flg = false
$(".editable").each (index) ->
if index == 0
first = $(this).attr('id')
if flg == true
target = $(this).attr('id')
status key command
Composition Backspace Backspace
Conversion Backspace Cancel
Precomposition Backspace Revert
Composition Ctrl [ Cancel
Conversion Ctrl [ Cancel
Composition Ctrl @ ConvertToHalfAlphanumeric
Conversion Ctrl @ ConvertToHalfAlphanumeric
Precomposition Ctrl Backspace Undo
Prediction Ctrl Delete DeleteSelectedCandidate
@yasunori
yasunori / map_with_index.rb
Created September 15, 2015 09:46
use index in map
[1,2,3].map.with_index { |n,i| [i,n*2] } #=> [[0,2],[1,4],[2,6]]