状態が変化が多数ある場合に条件分岐を使うことなく状態変化を実現できます
状態毎のオブジェクトを作っておいて、状態を変えたいときは
コンテキスト内の状態オブジェクトを変更するだけで振舞いを容易に変更できます
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// YouTube Video: https://youtu.be/o52XYvwTQU0 | |
import SwiftUI | |
import WebKit | |
struct ContentView: View { | |
let webView = WebView(request: URLRequest(url: URL(string: "https://www.google.com")!)) | |
var body: some View { | |
VStack { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias j="cd (cat ~/Library/autojump/autojump.txt | sort -nr | awk '{print \$2}' | fzf +s)" |
Head Firstデザインパターン ―頭とからだで覚えるデザインパターンの基本Eric Freeman Elisabeth Freeman Kathy Sierra Bert Bates オライリージャパン 売り上げランキング: 57,159
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.Callbacks; | |
using UnityEditor.iOS.Xcode; | |
using System.IO; | |
public class PbxModifier | |
{ | |
[PostProcessBuild] | |
public static void OnPostprocessBuild(BuildTarget buildTarget, string path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Poly Separate | |
// Copyright (C) 2012 Basenji Games | |
// Licensed under the MIT license | |
string $selection[] = `ls -sl`; | |
sepMat($selection[0]); | |
global proc sepMat(string $object){ | |
string $shadingGroups[] = getSGsFromShape($object); | |
string $ParentName = ($object + "_lightMap_Group"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ignore_user_abort(true); | |
function syscall ($cmd, $cwd) { | |
$descriptorspec = array( | |
1 => array('pipe', 'w'), // stdout is a pipe that the child will write to | |
2 => array('pipe', 'w') // stderr |
As configured in my dotfiles.
start new:
tmux
start new with session name:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2013 Calvin Rien | |
* | |
* Based on the JSON parser by Patrick van Bergen | |
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html | |
* | |
* Simplified it so that it doesn't throw exceptions | |
* and can be used in Unity iPhone with maximum code stripping. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining |
NewerOlder