Skip to content

Instantly share code, notes, and snippets.

View ThekhoN's full-sized avatar
💭
(メ`ロ´)/

Ngaosathe ThekhoN

💭
(メ`ロ´)/
View GitHub Profile
@ThekhoN
ThekhoN / .block
Last active November 8, 2019 08:41
fresh block
license: mit
@ThekhoN
ThekhoN / .block
Created November 8, 2019 07:18
Favorite tooltip (complex version)
license: mit
@ThekhoN
ThekhoN / css transition end detect
Created December 21, 2016 12:52
css transition end detect
https://osvaldas.info/examples/detecting-css-animation-transition-end-with-javascript/oncssanimationend.js
@ThekhoN
ThekhoN / SwiperJS_detectSupport.js
Last active November 17, 2016 10:57
Swiper.js support check ~ if not supported show blocks
var isUCBrowser = navigator.userAgent.indexOf('UCBrowser') > 0;
var isIE_Browser = isIE_Browser_fn();
var isWindowsPhone = isWindowsPhone_fn();
if_SwiperSupported();
function isIE_Browser_fn() {
var ua = window.navigator.userAgent;
var IEcheck_Index = ua.indexOf("MSIE");
if (IEcheck_Index > 0) {
console.log('running IE browser < 11');
@ThekhoN
ThekhoN / IE_nonConsoleFix.js
Created November 17, 2016 10:54
IE_nonConsoleFix.js
!function(){for(var a,b=function(){},c=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeline","timelineEnd","timeStamp","trace","warn"],d=c.length,e=window.console=window.console||{};d--;)a=c[d],e[a]||(e[a]=b)}();
@ThekhoN
ThekhoN / debounce.js
Last active November 16, 2016 09:46
debounce.js
/* thanks https://davidwalsh.name/javascript-debounce-function */
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
@ThekhoN
ThekhoN / UserAgentCheck.js
Last active November 10, 2016 12:33
UserAgentCheck
// +++++ BrowserDetection +++++ //
//UC Browser
var isUCBrowserX99 = navigator.userAgent.indexOf('UCBrowser') > 0;
var userAgentX99 = navigator.userAgent;
//Internet Explorer & Windows Phone
var isIE_mobileBrowser = navigator.userAgent.indexOf('Windows Phone 8.1') > 0;
var isIE_Browser = isIE_Browser_fn();
function isIE_Browser_fn() {
var sAgent = window.navigator.userAgent;
@ThekhoN
ThekhoN / Setting up MongoDB - windows
Last active August 2, 2016 08:19
Setting up MongoDB - windows
Install from https://www.mongodb.com/download-center#community
Follow Instructions @https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/
///* * * FOR USE WITH Node.js * * *///
refer https://github.com/mongodb/node-mongodb-native
/*
Set up the MongoDB environment:
MongoDB requires a data directory to store all data.
MongoDB’s default data directory path is \data\db.
@ThekhoN
ThekhoN / ArrayMethods.txt
Last active July 11, 2016 07:36
Array methods:
//Filter Array and make Unique
var arr = [1,2,3,4,1];
function unique (arr){
return arr.filter(function(item, index, arr){
return arr.indexOf(item) === index;
//get index of first occuring item
//return if index of this item = index of first occuring instance of this item
})
}
@ThekhoN
ThekhoN / gist:de52c0892b207fba3287
Created February 19, 2016 03:55
atom packages - install these
atom-alignment
atom-html-preview
atom-jade
atom-jsx-transform
change-case