Skip to content

Instantly share code, notes, and snippets.

View ShingoFukuyama's full-sized avatar

Shingo Fukuyama ShingoFukuyama

  • Japan
View GitHub Profile
@ShingoFukuyama
ShingoFukuyama / emacs lock buffer to window with tabbar
Created February 4, 2014 03:32
Stick/Lock buffer to window, compatible with tabbar.el. Emacs
;; http://lists.gnu.org/archive/html/help-gnu-emacs/2007-05/msg00975.html
(defvar sticky-buffer-previous-header-line-format)
(define-minor-mode sticky-buffer-mode
"Make the current window always display this buffer."
nil " sticky" nil
(if sticky-buffer-mode
(progn
(set (make-local-variable 'sticky-buffer-previous-header-line-format)
// Common
"Close";
"Preference";
"Open";
"Clear";
"Delete";
"Cancel";
"Save";
"Choose";
@ShingoFukuyama
ShingoFukuyama / AsHomeApp
Last active April 24, 2023 02:42
[Bookmarklet] Save any website as a standalone home app
javascript:%3B%28function%28d%29%7Blet%20html%3Dd.querySelector%28%27html%27%29%3Blet%20head%3Dd.querySelector%28%27head%27%29%3Bif%28%21head%29%7Bhead%3Dd.createElement%28%27head%27%29%3Bhtml.appendChild%28head%29%3B%7D%0Afunction%20setMeta%28name%2Cvalue%29%7Blet%20meta0%3Dd.querySelector%28%27meta%5B%27+name+%27%5D%27%29%3Bif%28meta0%29%7Bmeta0.content%3Dvalue%3B%7Delse%7Bmeta0%3Dd.createElement%28%27meta%27%29%3Bmeta0.name%3Dname%3Bmeta0.content%3Dvalue%3Bhead.appendChild%28meta0%29%3B%7D%7D%0AsetMeta%28%27mobile-web-app-capable%27%2C%27yes%27%29%3BsetMeta%28%27apple-mobile-web-app-capable%27%2C%27yes%27%29%3BsetMeta%28%27apple-mobile-web-app-status-bar-style%27%2C%27black%27%29%3B%7D%29%28document%29%3B
@ShingoFukuyama
ShingoFukuyama / Font-Awesome-for-Emacs.el
Last active May 3, 2020 11:46
Show Font Awesome icons on Emacs
;; Assume you have already installed Font Awesome on the system
;; http://fortawesome.github.io/Font-Awesome/
(require 'ov)
;; Overlay Library
;; https://github.com/ShingoFukuyama/ov.el
;; Example 1: Insert all fonts at the cursor position
(defun font-awesome-insert-all ()
@ShingoFukuyama
ShingoFukuyama / emacs mac osx say
Last active November 5, 2018 12:50
Utilizing `say' command which Mac OSX has for Emacs.Region lines and then `M-x osx-say' to make OSX speak.
;; Region lines and then `M-x osx-say' to make OSX speak.
;; Adjust speak speed
(setq osx-say-speed 180)
;; Change voice
;; Kathy, Vicki, Victoria, Alex, Bruce, Fred
(setq osx-say-voice "Alex")
(setq osx-say-buffer "*osx say*")
@ShingoFukuyama
ShingoFukuyama / AppDelegate.swift
Created August 18, 2017 23:30
iOS project without storyboard. AppDelegate.swift
/*
1. Delete `main.storyboard`
2. Emptify `Main Interface` on the project's general page
3. Add below code inside `application:didFinishLaunchingWithOptions`
*/
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
self.window = UIWindow(frame: UIScreen.main.bounds)
if let window = self.window {
@ShingoFukuyama
ShingoFukuyama / org-table-convert-on-the-spot
Created December 10, 2013 07:47
Convert Emacs org style table to csv/tsv/html/etc on the spot, instead of creating a new file.
(defun org-table-convert-on-the-spot (&optional format)
(interactive)
(unless (org-at-table-p) (user-error "No table at point"))
(org-table-align) ;; make sure we have everything we need
(let* ((beg (org-table-begin))
(end (org-table-end))
(txt (buffer-substring-no-properties beg end))
(formats '("orgtbl-to-tsv" "orgtbl-to-csv"
"orgtbl-to-latex" "orgtbl-to-html"
"orgtbl-to-generic" "orgtbl-to-texinfo"
//
// UIScrollView+Scrollabitily.h
//
// Created by FukuyamaShingo on 9/4/14.
// Copyright (c) 2014 FukuyamaShingo. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIScrollView (Scrollabitily)
@ShingoFukuyama
ShingoFukuyama / ObjCTaptic.h
Last active May 2, 2018 14:12
Taptic API for iPhone 7, 7 Plus (Public API). And also for iPhone 6s, 6s Plus (Private API).
// StackOverflow: Taptic in iOS 9
// http://stackoverflow.com/a/36320245/3283039
#import <Foundation/Foundation.h>
#import <UIKit/UIDevice.h>
@import AudioToolbox;
#include <sys/sysctl.h>
#define VER_10_0_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0f)
@ShingoFukuyama
ShingoFukuyama / tabbar-config.el
Last active March 30, 2018 14:14
Configuration file. tabbar.el github https://github.com/dholm/tabbar
;;;tabbar github https://github.com/dholm/tabbar
;;http://d.hatena.ne.jp/tequilasunset/20110103/p1
;;http://d.hatena.ne.jp/plasticster/20110825/1314271209
(require 'tabbar)
(tabbar-mode 1)
;;; Don't enable mouse wheel on tab bar
(tabbar-mwheel-mode nil)
;;; Don't use group tab