Skip to content

Instantly share code, notes, and snippets.

//Orginal code from: https://gist.github.com/mecid/f8859ea4bdbd02cf5d440d58e936faec
//I just made some modification in appearnce, show monthly navigator and weekdays.
import SwiftUI
struct ContentView: View {
@Environment(\.calendar) var calendar
private var year: DateInterval {
calendar.dateInterval(of: .month, for: Date())!
@mecid
mecid / Calendar.swift
Last active September 2, 2025 01:55
SwiftUI Calendar view using LazyVGrid
import SwiftUI
extension Calendar {
func generateDates(
inside interval: DateInterval,
matching components: DateComponents
) -> [Date] {
var dates: [Date] = []
dates.append(interval.start)
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active July 24, 2025 16:11
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@cocopon
cocopon / GifRecorder.pde
Last active June 9, 2019 01:07
A class that makes it easy to record a sketch in animated GIF
/*
* GifRecorder - makes it easy to record a sketch in animated GIF
* (c) 2014 cocopon.
*/
import gifAnimation.*;
/*
* Usage:
*
* 0. Install a required library before using GifRecorder.
@GOROman
GOROman / ThetaTest.rb
Last active January 13, 2016 05:18
PCからTHETAのシャッターを切る最小限のサンプルプログラム
#!ruby
#
# THETAのシャッターをPCから遠隔で切るだけの例 by GOROman
#
# 参考にしたページ
# http://mobilehackerz.jp/contents/Review/RICOH_THETA
require 'socket'
@FiloSottile
FiloSottile / 32.asm
Last active January 31, 2025 03:22
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@mitomex
mitomex / Gruntfile.js
Created February 23, 2013 21:06
Gruntfile.js Stylus
module.exports = function(grunt) {
grunt.initConfig({
stylus: {
compile: {
options: {
compress: false
},
files: {
'./css/style.css': ['./styl/style.styl']
}
@keijiro
keijiro / remove_duplicate_entry_in_openwith.md
Created November 19, 2012 01:20
Remove duplicate entry in "Open With" menu

Mac でアプリのインストールやらアップデートやらを繰り返していると、Finder の右クリックメニューの中にある "Open With" (このアプリケーションで開く)にアプリが複数登録されてしまうことがある。

これらの重複したエントリーをクリアするには、ターミナルから次のコマンドを実行する。

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

そののち、Finder を一旦落とせば(ログアウトすれば)、重複したエントリーは取り除かれた状態となる。

@gaspanik
gaspanik / ST2: User-Preferences.sublime-settings
Created November 17, 2012 03:03
ST2: User-Preferences.Sample
{
"bold_folder_labels": true,
// サイドバーのフォルダ名を太字に
"caret_style": "phase",
// キャレットのスタイルを変える。他に「smooth」「blick」「solid」「wide」など
"disable_formatted_linebreak": true,
// Emmetを有効にすると、日本語変換確定後に文字が消えるのを防ぐ
"disabled_single_snippet_for_scopes": "",
// Emmetを有効にすると、HTMLで「php」の展開が「<?php ?>」にならない問題の回避
"draw_minimap_border": true,
@ounziw
ounziw / gist:3808882
Created October 1, 2012 00:54
twentytwelve 1.0 日本語
<?php
/**
* Translated by Fumito MIZUNO ( http://ounziw.com/ )
* License for translation: CC-BY-SA
*/
/**
* Twenty Twelve 関数と定義
*
* テーマをセットアップし、ヘルパー関数を提供する。
* ヘルパー関数はテーマでカスタムテンプレートタグとして使用する。