This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # coding: utf-8 | |
| require 'pp' | |
| require 'readline' | |
| class Ed | |
| class Command | |
| def initialize(secondary, primary, type, param) | |
| @secondary = secondary | |
| @primary = primary |
This file contains hidden or 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
| [Unit] | |
| Description=grive daemon | |
| [Service] | |
| ExecStart=/bin/bash -c 'while true; do grive -p ~/GoogleDrive; inotifywait -r -t 1000 -e modify,move,create,delete ~/GoogleDrive; done' | |
| [Install] | |
| WantedBy=default.target |
This file contains hidden or 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
| NAME = ARGV[0] | |
| FILE = File.open(NAME) | |
| CONTENT = FILE.read | |
| LINES = CONTENT.scan(/(\r\n|\r|\n)/).size | |
| WORDS = CONTENT.lines.map { |l| l.split(/\p{blank}+/).select { |w| w =~ /\S/ }.size }.reduce(:+) | |
| BYTES = FILE.size | |
| I = [LINES, WORDS, BYTES].map { |n| n.to_s.size }.max | |
| printf "%#{I}d %#{I}d %d %s\n", LINES, WORDS, BYTES, NAME |
This file contains hidden or 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
| declare i32 @printf(i8* noalias nocapture, ...) | |
| define i32 @main() { | |
| %ds = alloca [4 x i8] | |
| store [4 x i8] c"%d\0a\00", [4 x i8]* %ds | |
| %dp = getelementptr [4 x i8], [4 x i8]* %ds, i64 0, i64 0 | |
| %x1 = alloca i32 | |
| store i32 1, i32* %x1 | |
| %x2 = alloca i32 | |
| store i32 1, i32* %x2 |
This file contains hidden or 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
| module SimpLisp where | |
| import Control.Monad | |
| import Data.Maybe | |
| import Text.ParserCombinators.Parsec | |
| data LVal = LAtom String | |
| | LList [LVal] | |
| | LNumber Double | |
| | LString String |
This file contains hidden or 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
| var PLUGIN_INFO = | |
| <KeySnailPlugin> | |
| <name>HoK Private</name> | |
| <description>add hok-start-private-mode</description> | |
| <version>0.1</version> | |
| <updateURL>https://gist.github.com/ncaq/241aeef4f01a0bac625341f1c873063d/raw</updateURL> | |
| <author mail='[email protected]' homepage='https://www.ncaq.net'>ncaq</author> | |
| <license>The MIT License</license> | |
| <minVersion>1.8.0</minVersion> | |
| <include>main</include> |
This file contains hidden or 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
| var PLUGIN_INFO = | |
| <KeySnailPlugin> | |
| <name>open in chromium</name> | |
| <description>add open-document-in-chromium</description> | |
| <version>0.1</version> | |
| <updateURL>https://gist.githubusercontent.com/ncaq/c8a23b50ab25f54e6ab12a3310b563f1/raw</updateURL> | |
| <author mail='[email protected]' homepage='https://www.ncaq.net'>ncaq</author> | |
| <license>The MIT License</license> | |
| <minVersion>1.8.0</minVersion> | |
| <include>main</include> |
This file contains hidden or 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
| set editing-mode emacs | |
| # control | |
| "\C-b": backward-delete-char | |
| "\C-h": backward-char | |
| "\C-n": history-search-forward | |
| "\C-s": forward-char | |
| "\C-t": history-search-backward |
This file contains hidden or 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
| f :: Integer -> Integer | |
| f n = n + 1 | |
| b :: Integer -> Integer -> Integer | |
| b m n | |
| | m == 0 && n > 0 = f n | |
| | m > 0 && n == 0 = b (m - 1) 1 | |
| | otherwise = b (m - 1) (b m (n - 1)) | |
| g :: Integer -> Integer |
This file contains hidden or 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 S | |
| { | |
| this(in int val)inout | |
| { | |
| val_ = val; | |
| } | |
| private int val_; | |
| } | |
| class C |