A brief example on how to use npx to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/ or watch it on YouTube https://www.youtube.com/watch?v=fSHWc8RTJug
| /* -- addToCart -- */ | |
| document.getElementById(\"button-cart\").addEventListener(\"click\", raAddToCart); | |
| function raAddToCart(){ | |
| _ra.addToCart({$mouseOverAddToCart_product_id}, ".(($product_details['quantity'] > 0) ? 1 : 0).", false, function() { | |
| console.log('addToCart FIRED!') | |
| }); | |
| }; |
| // Finds the length of the longest consecutive 1s | |
| // in a binary representation of a given number. | |
| function maxConsecutiveOnes(x) | |
| { | |
| // Initialize result | |
| let count = 0; | |
| while (x != 0) | |
| { | |
| x &= (x << 1); |
A brief example on how to use npx to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/ or watch it on YouTube https://www.youtube.com/watch?v=fSHWc8RTJug
| public class MineSweeper { | |
| private int[][] myTruth; | |
| private boolean[][] myShow; | |
| public void cellPicked(int row, int col) { | |
| if (inBounds(row, col) && !myShow[row][col]) { | |
| myShow[row][col] = true; | |
| if (myTruth[row][col] == 0) { | |
| for (int r = -1; r <= 1; r++) | |
| for (int c = -1; c <= 1; c++) cellPicked(row + r, col + c); | |
| } |
| #include <stdio.h> | |
| #include <time.h> | |
| #include <windows.h> | |
| #include <stdlib.h> | |
| int main() { | |
| struct tm * tmp; | |
| time_t s; | |
| for (;;) { |
| <!DOCTYPE html> | |
| <title>My Example</title> | |
| <time id="date"></time> | |
| <script> | |
| /* | |
| Create a JavaScript Date object for the current date and time, | |
| then extract the desired parts, then join them again in the desired format. | |
| */ |
| <html> | |
| <head> | |
| <title>A File Upload Script</title> | |
| </head> | |
| <body> | |
| <div> | |
| <?php | |
| if ( isset( $_FILES['fupload'] ) ) { |
| import urllib | |
| import re | |
| print "we will try to open this url, in order to get IP Address" | |
| url = "http://checkip.dyndns.org" | |
| print url | |
| request = urllib.urlopen(url).read() |
| # Clone the Quick Start repository | |
| $ git clone https://github.com/electron/electron-quick-start | |
| # Go into the repository | |
| $ cd electron-quick-start | |
| # Install the dependencies and run | |
| $ npm install && npm start |
| electron-quick-start | |
| - index.html | |
| - main.js | |
| - package.json | |
| - render.js |