Skip to content

Instantly share code, notes, and snippets.

View basuke's full-sized avatar
🍺
beer

Basuke Suzuki basuke

🍺
beer
View GitHub Profile
@basuke
basuke / ascii-table.md
Last active August 10, 2022 16:26
table #13
0 1 2 3 4 5 6 7 8 9 A B C D E F
0x20 ! " # $ % & ' ( ) * + , - . /
0x30 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
0x40 @ A B C D E F G H I J K L M N O
0x50 P Q R S T U V W X Y Z [
@basuke
basuke / create-vlog-project.py
Last active May 31, 2024 05:01
A python script to create a DaVinci Resolve project with today's date and import media files into default timeline.
import os
import sys
import datetime
from glob import glob
from argparse import ArgumentParser
# settings
projectNamePrefix = "vlog-"
presetName = "Default" # You have to define this preset by your self. <----
@basuke
basuke / Main.elm
Created January 30, 2018 07:15
Calc UI with sample event handling
module Main exposing (main)
import Html exposing (Html, button, div, text)
import Html.Events exposing (onClick)
main : Program Never Model Msg
main =
Html.beginnerProgram
{ model = 0
@basuke
basuke / Main.elm
Created January 29, 2018 05:11
Calc UI
module Main exposing (main)
import Html exposing (Html, button, div, text)
import Html.Events exposing (onClick)
main : Program Never Model Msg
main =
Html.beginnerProgram
{ model = 0
#include <curl/curl.h>
#include <stddef.h>
#include <unistd.h>
static const char* STATE_0 = "started";
static const char* STATE_1 = "paused";
static const char* STATE_2 = "resumed";
static size_t writeFunction(char* ptr, size_t blockSize, size_t numberOfBlocks, void* userData)
{
@basuke
basuke / memorandum.md
Last active April 7, 2017 00:01
Policy Memorandum

Policy Memorandum

U.S. Citizenship and Immigration Services
Office of the Director (MS 2000)
Washington, DC  20529-2000

March 31, 2017
PM-602-0142

SUBJECT:

@basuke
basuke / InvalidMimeGrammar.php
Created April 28, 2015 07:56
How to use RFC-invalid email addresses used by Japanese Cell carriers, DoCoMo and EZWeb using SwiftMailer
<?php
class InvalidMimeGrammar extends \Swift_Mime_Grammar {
/**
* Get the grammar defined for $name token.
* @param string $name exactly as written in the RFC
* @return string
*/
public function getDefinition($name)
{
@basuke
basuke / playing.php
Created October 14, 2014 18:56
AlfredTweet patch. track informations should not be encoded to utf-8 at this point. Workflow seems to handle encoding correctly.
/**
* Description
* Accepts a player name as an argument and reads the values
* of the track name and artist for the currently playing track
* of that player
*
* @param $player - name of the player to read data from
* @return array - array of track name and artist for that player
*/
function get_tracks( $players )
@basuke
basuke / mosquitto.init.sh
Last active February 22, 2019 19:51
Amazon Linux Init script for mosquitto MQTT 3.1 broker.
#!/bin/bash
#
# mosquitto This shell script takes care of starting and stopping
# mosquitto (MQTT 3.1 broker) on Amazon Linux.
#
# chkconfig: - 58 74
# description: mosquitto is a MQTT 3.1 broker. \
# http://mosquitto.org/
### BEGIN INIT INFO
# -*- coding: utf-8
import RPi.GPIO as GPIO
import mosquitto
import sys
from datetime import datetime
PINS = (18, 23, 24, 25)
SERVER = "sample.example.com"