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
| var fs = require('fs'); | |
| var url = require('url'); | |
| var exec = require('child_process').exec; | |
| var spawn = require('child_process').spawn; | |
| // Function to download file using wget | |
| var download_file_wget = function(file_url, download_dir, file_name_to_save, onProgress, cb) { | |
| // extract the file name | |
| var file_name = url.parse(file_url).pathname.split('/').pop(); |
| /** | |
| * Simple Node.js script to turn a specific page on a Google Sheet | |
| * into a JSON object for the main purpose of HTML Templating. | |
| * | |
| * @author jonobr1 / http://jonobr1.com | |
| * | |
| */ | |
| var https = require('https'); | |
| var path = require('path'); |
| // dropzoneWordpressForm is the configuration for the element that has an id attribute | |
| // with the value dropzone-wordpress-form (or dropzoneWordpressForm) | |
| Dropzone.options.dropzoneWordpressForm = { | |
| //acceptedFiles: "image/*", // all image mime types | |
| acceptedFiles: ".jpg", // only .jpg files | |
| maxFiles: 1, | |
| uploadMultiple: false, | |
| maxFilesize: 5, // 5 MB | |
| //addRemoveLinks: true, | |
| //dictRemoveFile: 'X (remove)', |
| var ajax = (function () { | |
| var ajax = {}; | |
| ajax.get = function (url, callbackFunc) { | |
| var req = prepareRequest('GET', url, callbackFunc); | |
| req.send(); | |
| } | |
| ajax.post = function (url, params, callbackFunc) { | |
| var req = prepareRequest('POST', url, callbackFunc); |
| library(rjson) | |
| trim <- function (x) gsub("^\\s+|\\s+$", "", x) | |
| data_dir = 'Documents/playlists/' | |
| play_list = list() | |
| for(i in list.files(data_dir,"^.*\\.(m3u)$")){ | |
| year = substr(i,1,4) # record file specific information, in this case year from playlist group | |
| <?php | |
| /* Adds all user meta to the /wp-json/wp/v2/user/[id] endpoint */ | |
| function sb_user_meta( $data, $field_name, $request ) { | |
| if( $data['id'] ){ | |
| $user_meta = get_user_meta( $data['id'] ); | |
| } | |
| if ( !$user_meta ) { | |
| return new WP_Error( 'No user meta found', 'No user meta found', array( 'status' => 404 ) ); | |
| } |
| 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; |