Skip to content

Instantly share code, notes, and snippets.

View FrankFang's full-sized avatar
🎯
Focusing

Frank Fang FrankFang

🎯
Focusing
View GitHub Profile
let g:neocomplcache_enable_cursor_hold_i=1
let g:neocomplcache_cursor_hold_i_time=300
autocmd InsertEnter * call s:on_insert_enter()
function! s:on_insert_enter()
if &updatetime > g:neocomplcache_cursor_hold_i_time
let s:update_time_save = &updatetime
let &updatetime = g:neocomplcache_cursor_hold_i_time
endif
endfunction
@FrankFang
FrankFang / text-overflow.css
Created October 24, 2013 06:09
text overflow
div{
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
module.exports = function(grunt){
grunt.init({
//task options go here
});
//load grunt tasks
grunt.loadNpmTasks('task goes here'); /* example grunt.loadNpmTasks('compass'); */
@FrankFang
FrankFang / sleep.js
Created December 5, 2013 08:14
JS sleep
function sleep(millis){
var date = new Date();
var currentDate = null;
do { currentDate = new Date(); }
while(currentDate - date < millis);
}
{
"name": "my-app",
"version": "0.0.0",
"dependencies": {
"browserify": "~2.36.1",
"less": "~1.5.1"
},
"devDependencies": {
"watchify": "~0.4.1",
"catw": "~0.2.0"
@FrankFang
FrankFang / location.origin.js
Last active January 2, 2016 02:09
hack location.origin
if (!window.location.origin) {
window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
}
// https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills#other
@FrankFang
FrankFang / remove_icon.css
Created January 6, 2014 02:25
Removing Clear and reavel password icons from IE10
input::-ms-clear, input::-ms-reveal{
display:none;
}
/* http://stackoverflow.com/questions/17000562/removing-clear-and-reavel-password-icons-from-ie10-ms-clear-ms-reveal-not */
node_modules/
.idea/
@FrankFang
FrankFang / call_numeric_keyboard.html
Created January 13, 2014 06:59
Call numeric keyboard
<input type="text" pattern="\d*">
@FrankFang
FrankFang / range.js
Created February 19, 2014 11:08
range.js
Array.apply(null, Array(3)).map(Function.prototype.call.bind(Number))
Array.apply(null, Array(3)).map(function(value,index){return index})