Skip to content

Instantly share code, notes, and snippets.

@senhalil
senhalil / gist:fd5e06913523cb9d45b3123ebd186573
Last active October 3, 2023 11:47 — forked from Ricket/gist:78bcd681db86bcbb134558428c4c6cb4
git diff -- use json_xs to pretty-print the json before diffing it
sudo apt-get install libjson-xs-perl
echo "*.json diff=json" >> ~/.gitattributes
git config --global core.attributesfile ~/.gitattributes
git config --global diff.json.textconv "json_xs -e \"print JSON::XS->new->utf8->pretty->canonical->encode(\\\$_)\" -t none < \"\$1\""
@kepano
kepano / obsidian-web-clipper.js
Last active May 2, 2024 13:07
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@bvlion
bvlion / payBackContact.js
Created June 6, 2021 03:48
Google スプレッドシートで始めるアプリ運用
var userName = ''
var gmailUserName = ''
var gmailAddress = ''
function reply() {
var sheet = SpreadsheetApp.getActiveSheet()
var active = sheet.getActiveCell()
if (sheet.getName() != 'contact') {
return
}
@bvlion
bvlion / code.gs
Last active February 24, 2023 04:20
GAS で土日祝日一覧を作成する
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
function doGet(e) {
if (e.parameter == undefined) {
throw new Error("固定パラメータなし");
}
// 日付を取得
var date = e.parameter.date;
@tx-TEM
tx-TEM / sample01.md
Last active September 22, 2022 07:07
Swift 個人用コードまとめ

コードから利用できるUIViewを作成する

import UIKit

final class CommonSectionHeader: UIView {
    @IBOutlet var titleLabel: UILabel!
    override init(frame: CGRect) {
        super.init(frame: frame)
        commonInit()
    }
@z80oolong
z80oolong / 00_TMUX_FIX.md
Last active October 4, 2021 22:50
tmux 2.5 以降において East Asian Ambiguous Character を全角文字の幅で表示する

tmux 2.5 以降において East Asian Ambiguous Character を全角文字の幅で表示する

告知 (2019/03/15, 2020/04/29)

これまで、本稿の Gist にて公開しておりました [tmux 2.5][TMUX] 以降において [East Asian Ambiguous Character][EAWA] を全角文字の幅で表示する為の差分ファイルについて、差分ファイルの分量が多くなったことに伴い、今後は以下の [Github][GITH] のリポジトリにて [tmux][TMUX] の [East Asian Ambiguous Character][EAWA] 対応差分ファイルを公開することと致します。

また、今後 [East Asian Ambiguous Character][EAWA] 対応の [tmux][TMUX] の導入を御考えの方は、後述する [Linuxbrew][BREW] を用いた差分ファイルの適用及びインストール若しくは、 [AppImage パッケージ][APPR]を用いたインストールを御勧め致します。

@kotakanbe
kotakanbe / mohikan_slack_channels.md
Last active October 14, 2023 19:26
モヒカンslack( https://mohikan.slack.com )のチャネルリスト
@mvarie
mvarie / WhereAmIRunning.swift
Last active September 16, 2020 10:33
Detects whether we're running in a Simulator, TestFlight Beta or App Store build
//
// WhereAmIRunning.swift
// https://gist.github.com/mvarie/63455babc2d0480858da
//
// ### Detects whether we're running in a Simulator, TestFlight Beta or App Store build ###
//
// Based on https://github.com/bitstadium/HockeySDK-iOS/blob/develop/Classes/BITHockeyHelper.m
// Inspired by http://stackoverflow.com/questions/18282326/how-can-i-detect-if-the-currently-running-app-was-installed-from-the-app-store
// Created by marcantonio on 04/11/15.
//
@kishikawakatsumi
kishikawakatsumi / main.m
Created January 14, 2014 18:52
One-line fix for UITextView on iOS 7
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"UIDisableLegacyTextView"];
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
@ole
ole / update_storyboard_strings.sh
Last active April 4, 2022 06:11
Automatically extract translatable strings from Xcode storyboards and update .strings files. Original version by MacRumors forum user mikezang (http://forums.macrumors.com/showpost.php?p=16060008&postcount=4). Slightly updated by Ole Begemann. NOTE: this Gist moved to a regular repo at https://github.com/ole/Storyboard-Strings-Extraction.
# (File moved to https://github.com/ole/Storyboard-Strings-Extraction)