Skip to content

Instantly share code, notes, and snippets.

@jordansinger
jordansinger / AppleLogo.swift
Created June 16, 2021 18:37
Original Apple logo in SwiftUI
import SwiftUI
struct ContentView: View {
var body: some View {
VStack(spacing: 0) {
Color.green
Color.green
Color.green
Color.yellow
Color.orange
## アンマネージドのインスタンスグループの作成
❯ gcloud compute instance-groups unmanaged create test-uig --zone asia-northeast1-b
Created [https://www.googleapis.com/compute/v1/projects/k8s-day/zones/asia-northeast1-b/instanceGroups/test-uig].
NAME LOCATION SCOPE NETWORK MANAGED INSTANCES
test-uig asia-northeast1-b zone 0
## 作成したアンマネージドのインスタンスグループの確認
❯ gcloud compute instance-groups unmanaged list
NAME ZONE NETWORK NETWORK_PROJECT MANAGED INSTANCES
test-uig asia-northeast1-b No 0
@enakai00
enakai00 / DCGEN_MNIST_Demo.ipynb
Created September 22, 2016 07:36
DCGEN Demonstration using MNIST dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@evanhalley
evanhalley / verify.js
Last active August 23, 2018 07:35
Using JavaScript / Node.js to do server side IAB signature verification
var crypto = require('crypto');
// the Base64 encoded Google Play license key / Base64-encoded RSA public key from the Google Play Dev Console
var publicKey = "ABCEDF1234....";
/** sample
{
"orderId":"12999763169054705758.1371079406387615",
"packageName":"com.example.app",
"productId":"exampleSku",
@naotochan
naotochan / python_fetch_image
Last active May 2, 2017 07:42
to fetch images on website by python
# encoding : utf-8
# for python3
import urllib.request
import os.path
import pyquery as pq
import requests
def download(url, folderName):
if not os.path.exists(folderName):
print (folderName + "フォルダを作成しました")
@polbins
polbins / README.md
Last active February 29, 2024 09:58
Simple RecyclerView Divider

Simple RecyclerView Divider

Simple Horizontal Divider Item Decoration for RecyclerView

    mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
            getApplicationContext()
    	));

NOTE: Add item decoration prior to setting the adapter

@sararob
sararob / data-structure.js
Last active April 26, 2022 22:21
Role-based security in Firebase
/*
This example shows how you can use your data structure as a basis for
your Firebase security rules to implement role-based security. We store
each user by their Twitter uid, and use the following simplistic approach
for user roles:
0 - GUEST
10 - USER
20 - MODERATOR
@kitak
kitak / doc.md
Last active October 18, 2023 09:57
コマンドによる「負荷」の原因切り分け

コマンドによる「負荷」の原因切り分け

この文章では、Linuxコマンド、sar, top, psを使って、一般的に負荷といわれるものの原因を切り分けることを目的とする。

そもそも負荷とは

「複数のタスクによるサーバリソースの奪い合いの結果に生じる待ち時間」を一言で表した言葉。OSのチューニングとは負荷の原因を知り、それを取り除くことにほかならない。

ボトルネックの見極め作業の大まかな流れ

  • ロードアベレージ(処理を実行したくても、実行できなくて待たされているプロセス(CPUの実行権限が与えられるのを待っている、またはディスクI/Oが完了するのを待っている)の数)を見る