Skip to content

Instantly share code, notes, and snippets.

View sarunw's full-sized avatar
🍎
iOS, Swift, SwiftUI

Sarun Wongpatcharapakorn sarunw

🍎
iOS, Swift, SwiftUI
View GitHub Profile
<div class="social">
<span class="twitter">
<a href="http://twitter.com/share" class="twitter-share-button" data-url="[your-url-here]">Tweet</a>
</span>
<span class="google">
<g:plusone size="medium" href="[your-url-here]"></g:plusone>
</span>
<span class="Facebook">
<iframe src="https://www.facebook.com/plugins/like.php?href=[your-url-here]&amp;show_faces=false&amp;layout=button_count" scrolling="no" frameborder="0" style="height: 21px; width: 100px" allowTransparency="true"></iframe>
</span>
@sarunw
sarunw / Podfile.ruby
Last active October 23, 2015 11:30 — forked from orta/Podfile.ruby
make frameworks the same as your bundle id
post_install do |installer|
app_plist = "Emergence/Info.plist"
plist_buddy = "/usr/libexec/PlistBuddy"
version = `#{plist_buddy} -c "Print CFBundleShortVersionString" #{app_plist}`
puts "Updating CocoaPods' version numbers to #{version}"
installer.pods_project.targets.each do |target|
`#{plist_buddy} -c "Set CFBundleShortVersionString #{version}" "Pods/Target Support Files/#{target}/Info.plist"`
end
end
@sarunw
sarunw / ruby_readline_issue.md
Created April 21, 2018 06:19 — forked from soultech67/ruby_readline_issue.md
ruby bundler: Sorry, you can't use byebug without Readline

Preamble

On OS/X Sierra, after recently running a brew update I started receiving the error message Sorry, you can't use byebug without Readline when trying to run some rake tasks in my ruby project folder. I observed this in projects and gems that include byebug or pry in their Gemfile or gem.spec. I've found in my googling that many begin encountering this error message after running a brew update but there are other triggering conditions as well.

>> rake aws:show_config
WARN: Unresolved specs during Gem::Specification.reset:
      mime-types (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
 Sorry, you can't use byebug without Readline. To solve this, you need to
@sarunw
sarunw / rails-deploy-to-digitalocean.md
Created September 7, 2018 08:43 — forked from kylefdoherty/rails-deploy-to-digitalocean.md
Notes for myself on How to Deploy a Rails App to DigitalOcean with Ubuntu 14.04, Phusion Passenger & Nginx, Postgres, and Capistrano

How to Deploy a Rails App to DigitalOcean with Ubuntu 14.04, Phusion Passenger & Nginx, Postgres, and Capistrano

1. Setup DigitalOcean Droplet

  • Choose Server Image

choose server image

  • Choose Size (if this is a hobby app you can probably get away with the smallest)

choose server size

@sarunw
sarunw / README.md
Created May 29, 2019 19:20 — forked from bazzel/README.md
Webpacker and I18n
$ rails new my-i8n --webpack

Gemfile

gem 'i18n-js'
@sarunw
sarunw / webpacker_rails.md
Created May 30, 2019 16:02 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
@sarunw
sarunw / 11ty_is.js
Created July 27, 2019 11:57 — forked from danfascia/11ty_is.js
11ty filter to filter items in a collection (array) whose key === value. (source: https://paulrobertlloyd.com/)
/**
* Select objects in array whose key matches a value
*
* @param {Array} arr Array to test
* @param {String} key Key to inspect
* @param {String} value Value key needs to match
* @return {String} Filtered array
*
*/
module.exports = function (arr, key, value) {
@sarunw
sarunw / 11ty_contains.js
Created July 27, 2019 11:57 — forked from danfascia/11ty_contains.js
11ty filter to filter a collection (array) by key:value pair - used to filter on custom taxonomies other than tags (source: https://paulrobertlloyd.com/)
/**
* Select objects in array whose key includes a value
*
* @param {Array} arr Array to test
* @param {String} key Key to inspect
* @param {String} value Value key needs to include
* @return {String} Filtered array
*
*/
module.exports = function (arr, key, value) {
@sarunw
sarunw / mac-keys-unicode.md
Created October 24, 2019 17:59 — forked from zmwangx/mac-keys-unicode.md
Unicode characters for special keys on the Mac keyboard (not necessarily Mac specific). #symbols

⌘ – &#x2318;&#8984; – the Command Key symbol
⌥ – &#x2325;&#8997; – the Option Key symbol
⇧ – &#x21E7;&#8679; – the Shift Key symbol
⌃ – &#x2303;&#8963; – the Control Key symbol
⎋ – &#x238B;&#9099; – the ESC Key symbol
⇪ – &#x21ea;&#8682; – the Capslock symbol
⏎ – &#x23ce;&#9166; – the Return symbol
⌫ – &#x232b;&#9003; – the Delete / Backspace symbol
⇥ – &#x21E5;&#8677; – the Tab Key symbol

@sarunw
sarunw / Lottie.stencil
Created July 17, 2020 15:43 — forked from djbe/Lottie.stencil
SwiftGen template for Lottie animations
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
{% if files %}
{% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %}
{% set documentPrefix %}{{param.documentName|default:"Document"}}{% endset %}
import Lottie
import UIKit
// swiftlint:disable superfluous_disable_command
// swiftlint:disable file_length