Skip to content

Instantly share code, notes, and snippets.

View nktpro's full-sized avatar

Jacky Nguyen nktpro

View GitHub Profile
@nktpro
nktpro / payload.json
Created November 24, 2021 07:17
Deno 1.16.x YAML-stringify regression
{
"apiVersion": "apiextensions.k8s.io/v1",
"kind": "CustomResourceDefinition",
"metadata": {
"name": "kafkas.kafka.strimzi.io",
"labels": {
"app": "strimzi",
"strimzi.io/crd-install": "true",
"component": "kafkas.kafka.strimzi.io-crd"
}
@nktpro
nktpro / MouseWheelDrag.js
Created July 4, 2012 01:20
Sencha Touch 2 MouseWheelDrag Recognizer
/**
* @author Jacky Nguyen
* @class Ux.event.recognizer.MouseWheelDrag
*
* Ext.Loader.setPath('Ux', '/path/to/your/app/ux');
*
* Ext.application({
* // ...
* eventPublishers: {
* touchGesture: {
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta id="extViewportMeta" name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<title></title>
<style type="text/css">
@nktpro
nktpro / gist:2363408
Created April 11, 2012 23:15
Iframe video fit
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../resources/css/sencha-touch.css">
<style type="text/css">
#video .x-innerhtml, #video iframe {
position: absolute;
left: 0;
top: 0;
@nktpro
nktpro / gist:1166962
Created August 24, 2011 00:02
Scroller CSS
.x-scroll-indicator, .x-scroll-indicator-csstransform {
opacity: 0.5;
-webkit-transition: opacity 0.2s ease-out;
}
.x-scroll-indicator {
background: #333;
-webkit-border-radius: 4px;
}
@nktpro
nktpro / gist:1114601
Created July 29, 2011 20:00
apply(*) pattern
applyFoo: function(foo) {
var currentFooInstance = this.getFoo();
// If foo config is an instance of Foo class, destroy the current instance (if it exists) and replace with the new one
if (foo instanceof Foo) {
if (currentFooInstance) {
currentFooInstance.destroy();
}
currentFooInstance = foo;