Skip to content

Instantly share code, notes, and snippets.

View tsmsogn's full-sized avatar
:octocat:
Set your status

tsmsogn tsmsogn

:octocat:
Set your status
View GitHub Profile
業務上関われない人はどうするのか?
時間をどの程度さいてよいのか
どうその人の査定に影響するのか
お客様からの評価、
定量的に人の評価なんかできるのだろうか?
@tsmsogn
tsmsogn / Selectable.php
Last active June 2, 2021 10:11
Laravel: Create array for select
<?php
namespace App\Traits;
use Illuminate\Database\Eloquent\Model;
trait Selectable
{
public static function toSelectArray()
{
@tsmsogn
tsmsogn / gist:ade22406dfa474363632fd0009fe0d61
Last active November 22, 2019 08:03
Laravel: Paginator#firstPageUrl(),Paginator#lastPageUrl()
  • first page url
$paginator->url(1)
  • last page url
$paginator-&gt;url($paginator-&gt;lastPage())
@tsmsogn
tsmsogn / gist:4c6e2a32360a87844f266ebbbc822570
Last active December 17, 2018 08:08
Fetch and cache the data
#!/bin/bash
set -e
cd $(dirname $0)
base=$(pwd)
url='' # INPUT URL
tmp_file=`date +%s`_shop.json # INPUT TEMPORARY FILE NAME
dest='shop.json' # INPUT OUTPUT FILE NAME
@tsmsogn
tsmsogn / kana2upper.js.gs
Created June 25, 2018 04:32 — forked from sa-nitawaki/kana2upper.js.gs
google spreadsheet で半角カナを全角カナにする関数 kana2upper() を作成
/*
How to use:
1)Create new file.
2)
*/
function kana2upper(string) {
@tsmsogn
tsmsogn / gist:0048340f1ddd05038f2b02dee4a9cc73
Last active June 21, 2018 06:22
CakePHP3: HTML tags generated with PaginatorHelper

環境

CakePHP 3.5.17

PaginatorHelper

echo '<!-- first() -->' .  $this->Paginator->first() . "\n";
echo '<!-- prev() -->' .  $this->Paginator->prev() . "\n";
echo '<!-- numbers() -->' .  $this->Paginator->numbers() . "\n";
web:
image: occitech/cakephp:5-apache
ports:
- 80
links:
- db
- mail
volumes:
- .:/var/www/html
environment:
@tsmsogn
tsmsogn / gist:4fd25693b7ad9486744265d2ff6f7725
Last active January 12, 2018 00:27
LINE message inspector for GAS
var access_token = "<INPUT_YOUR_ACCESS_TOKEN>";
var exclude_messages = []; // Ref: https://developers.line.me/ja/docs/messaging-api/reference/#webhook-event-objects
function doPost(e) {
var events = JSON.parse(e.postData.contents).events;
events.forEach(function(event) {
if (exclude_messages.indexOf(event.type) == -1) {
reply(event);
}
});
@tsmsogn
tsmsogn / erb_sample.rb
Last active December 28, 2016 02:13
[ruby]Output nested list with erb
require 'erb'
MY_CATEGORIES = <<SPEC
Fun
<%= ERB.new(FUN, nil, '-').result(binding) -%>
Work
<%= ERB.new(WORK, nil, '-').result(binding) -%>
SPEC
FUN = <<SPEC
@tsmsogn
tsmsogn / gist:e1e1c406e2f50ddf7876678ab38540fe
Created December 9, 2016 02:38 — forked from technoweenie/gist:1072829
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET