Skip to content

Instantly share code, notes, and snippets.

View kyungw00k's full-sized avatar
๐Ÿ‘‹

Kyungwook, Park kyungw00k

๐Ÿ‘‹
View GitHub Profile
@richard-flosi
richard-flosi / assertions-compareScreenshot.js
Created August 27, 2014 14:25
Nightwatch with Visual Regression testing
// assertions/compareScreenshot.js
var resemble = require('resemble'),
fs = require('fs');
exports.assertion = function(filename, expected) {
var screenshotPath = 'test/screenshots/',
baselinePath = screenshotPath + 'baseline/' + filename,
resultPath = screenshotPath + 'results/' + filename,
diffPath = screenshotPath + 'diffs/' + filename;
@gseguin
gseguin / jquery.mobile.vmouse.js
Last active December 10, 2020 07:13
Workaround Safari Mobile's bug with iframes and touch events described here: https://forum.jquery.com/topic/cannot-change-cursor-position-for-inputs-in-iframe
// This plugin is an experiment for abstracting away the touch and mouse
// events so that developers don't have to worry about which method of input
// the device their document is loaded on supports.
//
// The idea here is to allow the developer to register listeners for the
// basic mouse events, such as mousedown, mousemove, mouseup, and click,
// and the plugin will take care of registering the correct listeners
// behind the scenes to invoke the listener at the fastest possible time
// for that device, while still retaining the order of event firing in
// the traditional mouse environment, should multiple handlers be registered
@staltz
staltz / introrx.md
Last active April 29, 2025 08:33
The introduction to Reactive Programming you've been missing
@wbroek
wbroek / genymotionwithplay.txt
Last active February 13, 2025 09:37
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@chrisl8888
chrisl8888 / querySelector.polyfill.js
Created February 12, 2014 17:39
IE document.querySelector() polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
@yckart
yckart / README.md
Last active February 28, 2025 15:54
Checks if an element is inside another or if it collides with another. - http://stackoverflow.com/a/19614185/1250044

Usage:

var player = new Rect(0, 0, 100, 100);
var target = new Rect(50, 50, 100, 100);
player.is = new AABB(player);

player.is.inside(target);
player.is.colliding(target);
player.is.containing(target);
public class Dexter {
private static String optimizedDirectory = "optimized";
private static String workDirectory = "working";
public static void loadFromAssets(Context context, String fileName) throws Exception {
File optimized = new File(optimizedDirectory);
optimized = context.getDir(optimized.toString(), Context.MODE_PRIVATE);
optimized = new File(optimized, fileName);
@agaase
agaase / coverIframes
Last active September 18, 2019 18:57
This jquery extended function covers all the iframes inside an element with a transparent div and dispatches any "click"(only click) to the iframe. This is a workaround for the case when you dont want an iframe to swallow touch events on the page and is normally valid in the case of inline ads.
$.fn.coverIframes = function(){
$.each($("iframe",this),function(i,v){
var ifr = $(v);
var wr = $("<div id='wr"+new Date().getTime()+i+"' style='z-index: 999999; opacity: 0; position:absolute; width:100%;'></div>");
ifr.before(wr);
wr.height(ifr.height());
wr.click(function(event){
var iframe = ifr.get(0);
var iframeDoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document;
// Find click position (coordinates)
@cobyism
cobyism / osx-install-media.md
Last active March 11, 2023 00:42
Command to create installable OS X USB drive.

Creating a bootable macOS USB installer

  • First, plug in an 8GB (or bigger) USB drive, and use Disk Utility to erase it
  • If you use the default settings, you should wind up with a blank drive at /Volumes/Untitled.

With that volume in place, and with the macOS installer sitting in /Applications/Install\ macOS\ [VERSION].app, run the following command in your terminal to create a bootable install media (for Sierra):

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction
@benelog
benelog / AsyncTask-executor-problem.md
Last active August 27, 2021 16:15
AsyncTask ๋ถ„์„

๋ณ€๊ฒฝ์ด๋ ฅ

  • 2013/10/15: Dianne Hackborn์˜ ์–ธ๊ธ‰์— ๋Œ€ํ•œ ๋ฒˆ์—ญ์€ ์•ˆ์„ธ์›๋‹˜์ด ๊ต์ •ํ•ด์ฃผ์‹  ๋‚ด์šฉ์œผ๋กœ ๊ต์ฒดํ•ฉ๋‚˜๋””.

AsyncTask๋Š” API Level 13์ด์ƒ ๋ฒ„์ „์ด ์„ค์น˜๋œ ๊ธฐ๊ธฐ์—์„œ android:targetSdkVersion๊ฐ€ 13์ด์ƒ ์ผ ๋•Œ ์—ฌ๋Ÿฌ ๊ฐœ์˜ AsyncTask๊ฐ€ ๋™์‹œ์— ์‹คํ–‰๋˜์–ด๋„ ์ˆœ์ฐจ์ ์œผ๋กœ ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค.

๊ธฐ๊ธฐ์˜ ๋ฒ„์ „๋ฟ๋งŒ ์•„๋‹ˆ๋ผ targetSDK ์„ค์ •์—๋„ ์˜ํ–ฅ์„ ๋ฐ›์œผ๋ฏ€๋กœ target SDK ์„ค์ •์„ ๋ณ€๊ฒฝํ•  ๋•Œ ์œ ์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด ๋ชฉ์ ๋ณ„๋กœ ์Šค๋ ˆ๋“œํ’€์„ ๋ถ„๋ฆฌํ•˜๊ณ , ์Šค๋ ˆ๋“œ์˜ ๊ฐฏ์ˆ˜๊ฐ€ ๋Š˜์–ด๋‚˜๋Š” ๊ฒƒ์— ๋Œ€๋น„ํ•ด ๋ฌด์ž‘์ • ํฐ ์ตœ๋Œ€๊ฐ’์„ ์ฃผ๋Š”๊ฒƒ๋ณด๋‹ค๋Š” Timeout๊ณผ RejectionPolicy๋กœ ๊ด€๋ฆฌ๋ฅผ ํ•˜๋Š” ํŽธ์ด ๋ฐ”๋žŒ์งํ•ฉ๋‹ˆ๋‹ค.