クエリビルダは、SELECT文で「悲観的ロック」を行うための機能をいくつか持っています。SELECT文を実行する間「共有ロック」をかけたい場合は、sharedLockメソッドをクエリに指定して下さい。共有ロックはトランザクションがコミットされるまで、SELECTしている行が更新されることを防ぎます。
DB::table('users')
->where('votes', '>', 100)
->sharedLock()
->get();
''' | |
Copyright (c) 2020 Lucas Ryan | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so. |
#!/usr/bin/env bash | |
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime which can be found at: | |
# https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html | |
# | |
# As of Jan 10, 2019, this is: | |
# Amazon Linux AMI 2017.03.1.20170812 x86_64 HVM GP2 (ami-4fffc834) | |
# | |
# Lambda includes ImageMagick 6.7.8-9 preinstalled, so you need to prepend PATH | |
# with the folder containing these binaries in your Lambda function to ensure |
const functions = require('firebase-functions'); | |
const rp = require('request-promise'); | |
const projectId = process.env.GCP_PROJECT; | |
const region = 'us-central1'; | |
// GCF の List API を利用するためのサービスアカウント | |
// service account をリポジトリに含めたくない場合は下記のように機密データを取得する | |
// 設定方法: https://github.com/firebase/firebase-tools/issues/406#issuecomment-353017349 | |
const serviceAccount = functions.config().list.cert; |
<?php | |
//Composerでstripe/stripe-php をrequire済み | |
require_once __FILE__. './jp.php'; | |
try{ | |
Stripe\Stripe::setApiKey('sk_test_YOUR_KEY'); | |
Stripe\Charge::create([]); | |
}catch(Stripe\Error\Base $e) { | |
$err = $e->getJsonBody()['error']; | |
if(key_exists('code', $err)) { |
#!/bin/sh | |
# Reset Parallels Desktop's trial and generate a casual email address to register a new user | |
rm /private/var/root/Library/Preferences/com.parallels.desktop.plist /Library/Preferences/Parallels/licenses.xml | |
jot -w pdu%[email protected] -r 1 |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import struct | |
import types | |
import gzip | |
class IfoFileException(Exception): | |
"""Exception while parsing the .ifo file. | |
Now version error in .ifo file is the only case raising this exception. |
set -g default-terminal "xterm-256color" | |
set-option -ga terminal-overrides ",xterm-256color:Tc" | |
set -g prefix C-x | |
unbind-key C-x | |
bind-key C-2 send-prefix | |
bind \ split-window -h -c '#{pane_current_path}' | |
bind / split-window -v -c '#{pane_current_path}' | |
# Copy-paste integration |