Skip to content

Instantly share code, notes, and snippets.

View changmason's full-sized avatar

Mason Chang changmason

View GitHub Profile
@changmason
changmason / markdown-details-collapsible.md
Created November 9, 2021 03:48 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

A collapsible section containing markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
@changmason
changmason / readme.md
Created February 1, 2018 14:28 — forked from maxivak/readme.md
Chef. How to run scripts (recipes)

Run Chef scripts locally

There are several options to run recipes:

  • using chef-client with -z option
  • using chef-apply
  • using chef-solo

Before running Chef recipes on the machine, it should be prepared:

@changmason
changmason / Google Blogger Social Meta Tags.html
Created December 9, 2015 06:07 — forked from milanaryal/Google Blogger Social Meta Tags.html
Google Blogger/BlogSpot Social Meta Tags for Facebook, Twitter, Google+, Pinterest [v1.0]
<!-- add the following code in the head tag -->
<head prefix='og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#'>
<!-- Share Image -->
<link href='YOUR_LOGO_IMAGE' rel='image_src'/>
<!-- Open Graph Meta Tags -->
<b:if cond='data:blog.pageType != &quot;index&quot;'>
<meta expr:content='data:blog.title' property='og:site_name'/>
[
{author: "Pete Hunt", text: "This is one comment"},
{author: "Jordan Walke", text: "This is *another* comment"}
]
@changmason
changmason / keybase.md
Created June 25, 2014 09:56
Keybase Authentication

Keybase proof

I hereby claim:

  • I am changmason on github.
  • I am changmason (https://keybase.io/changmason) on keybase.
  • I have a public key whose fingerprint is 6E03 AF78 8944 9501 6F90 2831 3E5B ABDB 8E42 3790

To claim this, I am signing this object:

@changmason
changmason / rack_chaining.rb
Created October 12, 2011 06:45
rack middleware chaining
class M
def initialize(app)
@app = app
end
def call(env)
puts "Before call in middleware #{self.class}"
response = @app.call(env)
puts "After call in middleware #{self.class}"
response
@changmason
changmason / make_16_grids.rb
Created August 26, 2011 15:47
plot grids in Excel to make wireframes
require 'win32ole'
xls = WIN32OLE.new("Excel.Application")
xls.visible = true
wb = xls.workbooks.add()
ws = wb.worksheets(1)
(1..16).each do |i|
col = i * 3 -1
ws.columns(col).cells(1).value = i
@changmason
changmason / jruby_progress_bar_demo.rb
Created August 1, 2011 08:48
Swing progress bar demo in JRuby
# Program translate from
# http://download.oracle.com/javase/tutorial/uiswing/examples/components/ProgressBarDemoProject/src/components/ProgressBarDemo.java
# 2011/08/01 first commit (by Mason)
require "java"
java_import java.awt::Toolkit
java_import java.awt::Cursor
java_import java.awt::Insets
java_import java.awt::BorderLayout
java_import javax.swing::JFrame
@changmason
changmason / markdown
Created July 18, 2011 06:44
markdown syntax practice
Setext H1 Heading
=================
Setext H2 Heading
-----------------
# Atx H1 Heading #
## Atx H2 Heading ##
@changmason
changmason / gist:951357
Created May 2, 2011 09:25
Tasks to compile the jruby project into a standalone jar
# Compile the jruby project into a standalone jar, doc refers to
# https://github.com/jruby/jruby/wiki/StandaloneJarsAndClasses
namespace :pkg do
PGEM_FILES = []
PLIB_FILES = []
PROJECT_JAR = "package/project_name.jar"
JRUBY_JAR = "jruby-complete-1.6.1.jar"
BOOTSTRAP = "jar-bootstrap.rb"