This plugin detects a long press on any element for a specified amount of time.
- Copy longpress.js to your website
- Include it in your HTML after you include jQuery.
Usage
| 2 - Autos & Vehicles | |
| 1 - Film & Animation | |
| 10 - Music | |
| 15 - Pets & Animals | |
| 17 - Sports | |
| 18 - Short Movies | |
| 19 - Travel & Events | |
| 20 - Gaming | |
| 21 - Videoblogging | |
| 22 - People & Blogs |
| var express = require('express'); | |
| var app = express(); | |
| var fs = require('fs'); | |
| app.listen(3000, function() { | |
| console.log("[NodeJS] Application Listening on Port 3000"); | |
| }); | |
| app.get('/api/play/:key', function(req, res) { | |
| var key = req.params.key; |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
| <div class="wp_org_api"></div> | |
| <script> | |
| //setUp Post Data | |
| var actionType = 'hot_tags'; | |
| var number = 10; | |
| var timeout = 15; | |
| //Parse Post Data | |
| var postData = { |
| // Usage: node index.js "twitter search string" | |
| var request = require('request'); | |
| // Grab a bearer token using application-only auth | |
| // (doc: https://dev.twitter.com/oauth/application-only) |
| var mediaJSON = { "categories" : [ { "name" : "Movies", | |
| "videos" : [ | |
| { "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
| "subtitle" : "By Blender Foundation", | |
| "thumb" : "images/BigBuckBunny.jpg", | |
| "title" : "Big Buck Bunny" | |
| }, | |
| { "description" : "The first Blender Open Movie from 2006", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
| // Add / Update a key-value pair in the URL query parameters | |
| function updateUrlParameter(uri, key, value) { | |
| // remove the hash part before operating on the uri | |
| var i = uri.indexOf('#'); | |
| var hash = i === -1 ? '' : uri.substr(i); | |
| uri = i === -1 ? uri : uri.substr(0, i); | |
| var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); | |
| var separator = uri.indexOf('?') !== -1 ? "&" : "?"; | |
| if (uri.match(re)) { |
| angular.module('utils.filters', []) | |
| .filter('removeAccents', removeAccents); | |
| function removeAccents() { | |
| return function (source) { | |
| var accent = [ | |
| /[\300-\306]/g, /[\340-\346]/g, // A, a | |
| /[\310-\313]/g, /[\350-\353]/g, // E, e | |
| /[\314-\317]/g, /[\354-\357]/g, // I, i | |
| /[\322-\330]/g, /[\362-\370]/g, // O, o |
| /* | |
| Assuming jQuery Ajax instead of vanilla XHR | |
| */ | |
| //Get Github Authorization Token with proper scope, print to console | |
| $.ajax({ | |
| url: 'https://api.github.com/authorizations', | |
| type: 'POST', | |
| beforeSend: function(xhr) { | |
| xhr.setRequestHeader("Authorization", "Basic " + btoa("USERNAME:PASSWORD")); |
| [ | |
| { "code": "aa", "name": "Afar" }, | |
| { "code": "ab", "name": "Abkhazian" }, | |
| { "code": "ae", "name": "Avestan" }, | |
| { "code": "af", "name": "Afrikaans" }, | |
| { "code": "ak", "name": "Akan" }, | |
| { "code": "am", "name": "Amharic" }, | |
| { "code": "an", "name": "Aragonese" }, | |
| { "code": "ar", "name": "Arabic" }, | |
| { "code": "as", "name": "Assamese" }, |