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
VertexUniforms* p = (VertexUniforms*)[frameUniformBuffers[ren.activeBufferNumber] contents]; | |
matrix_float4x4 mat = ren.cameraMatrix * modelMatrix; | |
p->projectionView = ren.projectionMatrix * mat; | |
p->normal = matrix_invert(matrix_transpose(modelViewMatrix)); |
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
<script type="text/javascript" src="https://gist.github.com/{{ .Get 0 }}.js"></script> |
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
#!/bin/bash | |
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m" | |
hugo -t Hyde-X | |
cd public | |
git add -A | |
msg="hugo rebuilding site `date +%Y%m%d_%H-%M-%S`" | |
if [ $# -eq 1 ] | |
then msg="$1" | |
fi | |
git commit -m "$msg" |
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
struct appdata | |
{ | |
float4 vertex : POSITION; | |
float4 color : COLOR; | |
float2 texcoord : TEXCOORD0; | |
}; | |
v2f vert(appdata IN) | |
{ |
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
<figure> | |
<img src="/media/{{ dateFormat "2006-01-02" .Page.Date }}-{{ .Page.Slug }}/{{ .Get 0 }}" /> | |
</figure> |
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
@interface ObjC_Exception : NSObject | |
+ (void)objC_try:(nonnull void(^)())objC_try | |
objC_catch:(nonnull void(^)(NSException* _Nonnull))objC_catch | |
objC_finally:(nullable void(^)())objC_finally; | |
@end |
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
kernel void particleCompute(device ParticleData* in [[ buffer(0) ]], | |
device LaminateData* laminate [[ buffer(1) ]], | |
device VertexInOut* out [[ buffer(2) ]], | |
uint2 id [[ thread_position_in_grid ]], | |
uint2 size [[ threads_per_grid ]]) { | |
uint pos = id.x + id.y * size.x; | |
ParticleData data = in[pos]; | |
if (data.acc.y > 0) { // 落下中か判定 | |
float height = data.position.y + data.acc.y; // 落下後の高さ |
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
let りんご = 1 | |
let ばなな = 2 | |
switch () { | |
case _ where りんご > ばなな: print("りんごが多い") | |
case _ where りんご < ばなな: print("ばななが多い") | |
default: print("同じ") | |
} | |
// 上のswitch文と下のif文は等価 |
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
func application( | |
application: UIApplication, | |
didRegisterForRemoteNotificationsWithDeviceToken | |
deviceToken: NSData) { | |
var bytes = [UInt8](count: deviceToken.length, | |
repeatedValue: 0) | |
deviceToken.getBytes(&bytes, length: deviceToken.length) | |
let token = bytes.reduce("") { | |
$0 + String(format: "%02x", arguments: [$1]) |
OlderNewer