Skip to content

Instantly share code, notes, and snippets.

View Watson1978's full-sized avatar

Watson Watson1978

View GitHub Profile
@Watson1978
Watson1978 / github-flavored-markdown.rb
Created April 10, 2012 01:11
GitHub Flavored Markdown parser
#!/usr/local/bin/ruby
# To parse GitHub Flavored Markdown
#
# Setup
# $ sudo easy_install pygments
# $ sudo gem install pygments.rb
# $ sudo gem install redcarpet
require 'redcarpet'
require 'pathname'
BASERUBY = /Users/watson/.rbenv/shims/ruby --disable=gems
CC = clang -fdeclspec
LD = ld
LDSHARED = clang -fdeclspec -dynamiclib
CFLAGS = -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99 -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
DLDFLAGS = -Wl,-undefined,dyn
@Watson1978
Watson1978 / macruby_uninstall
Created February 27, 2012 23:43
MacRuby : uninstaller
#!/bin/bash
# MacRuby
rm -rf /Library/Frameworks/MacRuby.framework
XCODE_DIR=`xcode-select -print-path`
# tool
rm -f "$XCODE_DIR"/usr/bin/rb_nibtool
rm -f "$XCODE_DIR"/Tools/rb_nibtool
@Watson1978
Watson1978 / Dockerfile
Last active October 4, 2020 14:40
RMagick Issue #1228
FROM ubuntu:20.04
RUN apt update && \
apt install -y tzdata && \
apt install -y git pkg-config && \
apt install -y build-essential gcc g++ libx11-dev libxext-dev zlib1g-dev \
liblcms2-dev libpng-dev libjpeg-dev libfreetype6-dev libxml2-dev \
libtiff5-dev libwebp-dev gsfonts ghostscript wget
RUN wget https://imagemagick.org/download/releases/ImageMagick-7.0.10-32.tar.xz && \
@Watson1978
Watson1978 / README-badges.md
Created September 18, 2020 17:46 — forked from tterb/README-badges.md
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

@Watson1978
Watson1978 / speech.rb
Created October 24, 2010 08:30
sample of NSSpeechSynthesizer
#!/usr/bin/env macruby
# -*- coding: utf-8 -*-
require 'optparse'
framework 'AppKit'
class Speech
def initialize()
@speech = NSSpeechSynthesizer.alloc.initWithVoice(nil)
@speech.delegate = self
end
$ ruby -e 'require "rbconfig"; pp RbConfig::CONFIG'
{"DESTDIR"=>"",
"MAJOR"=>"2",
"MINOR"=>"8",
"TEENY"=>"0",
"PATCHLEVEL"=>"-1",
"INSTALL"=>"/usr/bin/install -c",
"EXEEXT"=>"",
"prefix"=>"/Users/watson/.rbenv/versions/2.8.0",
"ruby_install_name"=>"ruby",
Process: ruby [14019]
Path: /Users/USER/*/ruby
Identifier: ruby
Version: 0
Code Type: ARM-64 (Native)
Parent Process: zsh [1165]
Responsible: Terminal [1163]
User ID: 501
Date/Time: 2020-07-08 23:45:09.138 +0900
0 23.76953125
1 31.421875
2 39.07421875
3 39.07421875
4 39.07421875
5 46.71875
6 54.36328125
7 62.00390625
8 69.66796875
9 77.31640625
1 31.421875
2 39.07421875
3 39.07421875
4 39.07421875
5 46.71875
6 54.36328125
7 62.00390625
8 69.66796875
9 77.31640625