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 June 2, 2024 11:03
The introduction to Reactive Programming you've been missing
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
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)
@chrisjlee
chrisjlee / 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 May 19, 2023 06:37
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로 관리를 하는 편이 바람직합니다.