Coder Social home page Coder Social logo

javascript's Introduction

javascript

javascript related stuff

Please donate if you are using this repo

Note: If you found this project helpful please give this repo a star.

PayPal - The safer, easier way to pay online!

Index

Ripple effects

OCR: Optical character recognition
Bootstrap 3
Table with fixed headers and first column
Drag and drop

Load js and css files

function loadScript(url, callback)
{
    // Adding the script tag to the head as suggested before
    var head = document.getElementsByTagName('head')[0];
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = url;

    // Then bind the event to the callback function.
    // There are several events for cross browser compatibility.
    script.onreadystatechange = callback;
    script.onload = callback;

    // Fire the loading
    head.appendChild(script);
}

var myPrettyCode = function() {

   // Here, do what ever you want
};

loadScript("my_lovely_script.js", myPrettyCode);

function loadjscssfile(filename, filetype) {
    if (filetype == "js") { //if filename is a external JavaScript file
       // alert('called');
        var fileref = document.createElement('script')
        fileref.setAttribute("type", "text/javascript")
        fileref.setAttribute("src", filename)
        alert('called');
    }
    else if (filetype == "css") { //if filename is an external CSS file
        var fileref = document.createElement("link")
        fileref.setAttribute("rel", "stylesheet")
        fileref.setAttribute("type", "text/css")
        fileref.setAttribute("href", filename)
    }
    if (typeof fileref != "undefined")
        document.getElementsByTagName("head")[0].appendChild(fileref)
}

Find the largest number contained in a JavaScript array

var array = [267, 306, 108];
Math.max.apply(Math, array);
Result: 306

Find the smallest number contained in a JavaScript array

var array = [267, 306, 108];
Math.min.apply(Math, array);
Result: 108

Angular 2 cli

Angular 2 cli

Angular 2 Mobile Toolkit

Angular 2 Mobile Toolkit

html2canvas: Screenshots with JavaScript

html2canvas

GPU and Web UI Performance: Building an Endless 60fps Scroller

GPU and Web UI Performance: Building an Endless 60fps Scroller

scrollerjs.com

Mapzen

Mapzen is an open, sustainable, and accessible mapping platform. Our tools let you display, search, and navigate your world

Simple Statistics

Simple Statistics is a JavaScript library that implements statistical methods

regression.js

regression.js

Live Code Session - Supercharged

YouTube: Supercharged with Paul Lewis & Surma

UI Elements: A collection of UI element samples written with vanilla web platform features

hello.js

A client-side JavaScript SDK for authenticating with OAuth2 (and OAuth1 with a oauth proxy) web services and querying their REST APIs.

hello.js

Thorin.js

Thorin.js is the Node.js framework that you can use to easily:

  • Boot up a pre-configured web-server, sanitize and validate all your input
  • Render static HTML files using a templating engine, compile your less & sass styles
  • Integrate centralized logging with loglet.io
  • Use secure sessions in your requests, stored in redis, MySQL or file system
  • Use already written components for some wide-spread services (Redis, ElasticSearch, Sequelize)
  • Use a centralized dispatcher to handle your redux actions via HTTP or WebSockets
  • Schedule recurring tasks that may use a redis queue to process events
  • Extend the core functionality with use-case specific plugins
  • Integrate with sconfig.io's discovery system for microservice discovery & authorization
  • And much much more.

Thorin.js

Check if element is visible after scrolling

function isScrolledIntoView(el) {
    var elemTop = el.getBoundingClientRect().top;
    var elemBottom = el.getBoundingClientRect().bottom;

    var isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight);
    return isVisible;
}

Propeller.js: JavaScript library to rotate elements with mouse or touch gestures. Supports inertia and stepwise rotation. Optimized for better performance

Propeller.js

Ocrad.js Optical Character Recognition in JS

Ocrad.js

Tesseract.js is a pure Javascript port of the popular Tesseract OCR engine

Tesseract.js

Bootstrap 3 Datepicker

Datepicker

Stickybits is a lightweight alternative to position: sticky polyfills. It works perfectly for things like sticky headers.

Stickybits

Idle Logout

function idleLogout() {
    var t;
    window.onload = resetTimer;
    window.onmousemove = resetTimer;
    window.onmousedown = resetTimer; // catches touchscreen presses
    window.onclick = resetTimer;     // catches touchpad clicks
    window.onscroll = resetTimer;    // catches scrolling with arrow keys
    window.onkeypress = resetTimer;

    function logout() {
        window.location.href = 'logout.php';
    }

    function resetTimer() {
        clearTimeout(t);
        t = setTimeout(logout, 10000);  // time is in milliseconds
    }
}
idleLogout();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.