This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof xpathGetter === 'undefined') { | |
xpathGetter = function(){ | |
var isActive = false, | |
mode = "XPATH";//0 - xpath, 1-css, 2-id | |
version = "0.1", | |
codeTemplate = null, | |
iniatilized = false; | |
var pub = {}; | |
var self = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var codeTemplate = '\ | |
\ | |
<ul class="people_list"> \ | |
{{#each people}} \ | |
<li>{{this}}</li> \ | |
{{/each}} \ | |
</ul> \ | |
\ | |
'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$con = mysqli_connect ( $MYSQL_HOSTNAME, $MYSQL_USERNAME, $MYSQL_PASSWORD, $MYSQL_DATABASE ); | |
$tables = array (); | |
$result = mysqli_query ( $con, 'SHOW TABLES' ); | |
while ( $row = mysqli_fetch_array ( $result ) ) { | |
$tables [] = $row [0]; | |
} | |
// cycle through the tables | |
foreach ( $tables as $table ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Extend the Underscore object with the following methods */ | |
// Rate limit ensures a function is never called more than every [rate]ms | |
// Unlike underscore's _.throttle function, function calls are queued so that | |
// requests are never lost and simply deferred until some other time | |
// | |
// Parameters | |
// * func - function to rate limit | |
// * rate - minimum time to wait between function calls | |
// * async - if async is true, we won't wait (rate) for the function to complete before queueing the next request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const API = 'https://jsonplaceholder.typicode.com'; | |
// Data Fetching and Logic | |
const getData = (endpoint) => | |
fetch(`${API}/${endpoint}`) | |
.then(resp => resp.json()); | |
const findUserByUserName = (username) => | |
getData(`users?username=${username}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To Display disk mapping | |
lsblk | |
# Erase the disk with random strings | |
dd if=/dev/urandom of=/dev/null status=progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main function | |
customers = readFile('customer.dat'); | |
prefCustomers = readFile('preffrred.dat') | |
orders = readFile('orders.dat') | |
for (order in orders){ | |
customer = order.getCustomer(); | |
subtotal = order.calcuateTotal(); | |
currentAmountSpent = customer.getAmountSpent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a) Create a simple ReactJS front end in JS Fiddle using the Star Wars API https://swapi.co/ | |
b) List all the films in first page | |
c) List all the Characters in a film when you click on a film | |
d) Bonus points if you use React with Redux/Flux | |
e) Make sure your front end is responsive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script> | |
let data = [1,10,4,5,3,5,1,4,5]; | |
</script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.3.0/jasmine.js"></script> |