Skip to content

Instantly share code, notes, and snippets.

@fxfan
fxfan / barcode_reader.html
Created February 6, 2020 01:47
jQueryでバーコード読み取り
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Fieldless Key Input Sample</title>
<link rel="stylesheet" href="">
<style>
body {
case class Diary(date: String, content: String)
object Diary {
def apply(s: String): Diary = {
val lines = s.lines.toSeq
Diary(lines.head, lines.tail.mkString("\n"))
}
}
@fxfan
fxfan / code39.html
Created December 15, 2016 08:37
code39 library for canvas
<!DOCTYPE html>
<meta charset="utf-8">
<title>Code 39</title>
<style>
#barcode {
margin: 200px;
}
</style>
@fxfan
fxfan / piroriro.js
Created March 23, 2016 10:39
piroriro.js
$('#piroriro').on('click', function() {
var audio = new Audio();
audio.src = 'se_maoudamashii_onepoint20.mp3';
audio.play();
});
@fxfan
fxfan / $wait.js
Created July 28, 2015 19:07
Wait until elements exist.
var $wait = function(selector, callback) {
var maxTry = 100;
var i = 0;
var tryToQuery = function() {
if (i++ === maxTry) {
throw "Can't find the element: " + selector;
}
var e = $(selector);
@fxfan
fxfan / spaceship_upload_screenshot.rb
Created July 28, 2015 16:22
Temporary snipet that adds screenshot upload support to spaceship
require 'spaceship'
class Spaceship::Tunes::AppVersion
def upload_screenshot!(lang, device, image_filepath)
image = Spaceship::UploadFile::from_path image_filepath
detail = raw_data['details']['value'].find{ |d| d['language'] == lang }
screenshots = detail['screenshots']['value'][device.to_s]['value']
@fxfan
fxfan / app_version_cntrl.js
Created July 28, 2015 13:10
The script which is in charge of interacting with users on iTC version pages.
/************************************************************************************************************************/
/************************************************* app_version_cntrl.js *************************************************/
/************************************************************************************************************************/
'use strict';
define(['app'], function (itcApp) {
var appVersionController = function ($scope,$location, $timeout, $rootScope,$stateParams, appDetailsService, appVersionReferenceDataService, saveVersionDetailsService, saveVersionService, sharedProperties,linkManager,$sce, $upload,filterFilter, $filter, createAppVersionService, devRejectAppService, $state) {
window.scope = $scope;
@fxfan
fxfan / itc_candidate_builds_raw_data.rb
Created July 28, 2015 12:53
iTunesConnect candidate builds data structure as ruby hash
# version raw_data
{
# ...other propreties
preReleaseBuildIconUrl: 'https://is3-ssl.mzstatic.com/image/thumb/xxx/Icon-60@2x.png.png/150x150bb-80.png'
preReleaseBuildIsLegacy: false
preReleaseBuildTrainVersionString: '1.0.0'
preReleaseBuildUploadDate: 1438001487000
preReleaseBuildVersionString: { value: '1.0.0', isEditable: true, isRequired: false, errorKeys: nil }
@fxfan
fxfan / itc_ratings_raw_data.rb
Created July 28, 2015 07:31
iTunesConnect ratings data structure as ruby hash
{
ratings: {
ageBandMax: nil,
ageBandMin: nil,
allRatingLevels: [
"ITC.apps.ratings.level.YES",
"ITC.apps.ratings.level.NO",
"ITC.apps.ratings.level.NONE",
"ITC.apps.ratings.level.INFREQUENT_MILD",
"ITC.apps.ratings.level.FREQUENT_INTENSE"
# テキトーです
gameover:d=4,o=4,b=200:8c5,4p,8g4,4p,4e4,6a4,6b4,6a4,6g#4,6a#4,6g#4,4g4,4f4,2g4