Skip to content

Instantly share code, notes, and snippets.

John Lin johnlinvc

Block or report user

Report or block johnlinvc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@johnlinvc
johnlinvc / installing_MTGA_on_macOS_with_Retina_support.md
Created May 24, 2019 — forked from prestia/installing_MTGA_on_macOS_with_Retina_support.md
Instructions on how to install Magic the Gathering Arena on macOS with Retina support.
View installing_MTGA_on_macOS_with_Retina_support.md

Installing MTGA on macOS using Wine, and making it look pretty!

The following instructions are heavily inspired by /u/uhohohdear. I modified uhohohdear's instructions and then added support for Retina/HiDPI displays and instructions about how to update MTGA.

Dependencies

  1. Your macOS/OS X version must be 10.8 or greater
  2. Your Mac must support OpenGL 4.0 or greater (you can find out whether it does here)
  3. You must download the Magic the Gathering Arena Windows executable
  4. You must download a custom Wineskin wrapper [mirror]
View a.py
import os
import subprocess
os.environ["hello"] = "world"
subprocess.call(["python", "b.py"])
@johnlinvc
johnlinvc / swift-amzn-ami.sh
Created Oct 7, 2016 — forked from carsonmcdonald/swift-amzn-ami.sh
Build Swift on an Amazon Linux AMI
View swift-amzn-ami.sh
#
# Notes:
#
# I used the following AMI:
# "Amazon Linux AMI 2015.09.1 (HVM), SSD Volume Type - ami-60b6c60a"
# Running on AMI: amzn-ami-hvm-2015.09.1.x86_64-gp2 (ami-60b6c60a)
#
# You probably want to use an instance type with a large amount of memory. My first
# attempt was with a c4.2xlarge but it rant out of memory without using -j option to
# limit the parallel build.
@johnlinvc
johnlinvc / basketball.swift
Created Apr 11, 2016
basket ball shooting in spritekit
View basketball.swift
//: Playground - noun: a place where people can play
/*
README
just copy & paste the code into an iOS playground of Xcode 7.3+
click display timeline to play in the liveview
*/
import UIKit
import SpriteKit
View nokogiri_xmlns.rb
require 'nokogiri'
str = <<END
<cve xmlns:xsi="xxx">
<member>yyy</member>
</cve>
END
doc = Nokogiri::XML(str)
cve = doc.xpath("//cve")[0]
namespaces = cve.namespaces
View http_server.ino
/*
Web Server
A simple web server that shows the value of the analog input pins.
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
* Analog inputs attached to pins A0 through A5 (optional)
@johnlinvc
johnlinvc / echo_server.rb
Created Jan 1, 2016
ruby rack echo server
View echo_server.rb
require 'rack'
app = Proc.new do |env|
['200', {'Content-Type' => 'text/html'},
["hello #{env['rack.input'].read}"]]
end
Rack::Handler::WEBrick.run app
@johnlinvc
johnlinvc / buildlog.sh
Created Dec 30, 2015
swift-stdlib-macosx-x86_64 build fail log
View buildlog.sh
Building the standard library for: swift-stdlib-macosx-x86_64
cmark: using standard linker
++ cmake_config_opt cmark
++ product=cmark
++ [[ Ninja == \X\c\o\d\e ]]
+ /usr/local/bin/cmake --build /Users/johnlinvc/Projs/swift-core-2/build/Ninja-DebugAssert/cmark-macosx-x86_64 -- -j8 all
ninja: no work to do.
llvm: using standard linker
++ cmake_config_opt llvm
@johnlinvc
johnlinvc / arrayPassByValue.playground
Last active May 7, 2018
Demo how to pass array by reference in swift
View arrayPassByValue.playground
//: Playground - noun: a place where people can play
import UIKit
class Foo {
class ArrayWrapper{
var array:[Bool] = [false]
subscript(index: Int) ->Bool {
get{
return array[index]
View pre-commit.sh
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files
# for Pry binding references
#
# Installation
#
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit
#
# Based on
#
# http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/
You can’t perform that action at this time.