This file contains hidden or 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
| package main | |
| import ( | |
| "encoding/json" | |
| "errors" | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| ) |
This file contains hidden or 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 students = [ | |
| { | |
| firstName: 'Rahul', | |
| lastName: 'Baruri', | |
| marks: 809, | |
| group: 'science' | |
| }, | |
| { | |
| firstName: 'Ripan', | |
| lastName: 'Baruri', |
This file contains hidden or 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 message = 'Amar nam {{name}}, amar boyos {{age}}, and {{name}} er first letter R'; | |
| function render(text, values) { | |
| let str = text; | |
| Object.keys(values).forEach(key => { | |
| str = str.replace(new RegExp(`{{${key}}}`, 'g'), values[key]); | |
| }); | |
| return str; | |
| } |
This file contains hidden or 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
| #!/bin/sh | |
| STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
| ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint" | |
| if [[ "$STAGED_FILES" = "" ]]; then | |
| exit 0 | |
| fi | |
| PASS=true |
This file contains hidden or 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
| function curry(fn) { | |
| let i = 0; | |
| let countedArg = 0; | |
| let method = function(arg) { | |
| return arg; | |
| }; | |
| let args = []; | |
| while(i< fn.length) { | |
| method = (function(fun) { | |
| return function(...params) { |
This file contains hidden or 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
| function updateChargeInfo(battery) { | |
| var message = battery.charging ? "Charging now :D": "Need Charge" ; | |
| var batteryStatusNode = document.querySelector('.charging-status'); | |
| var classes = batteryStatusNode.classList; | |
| document.querySelector('#message').innerHTML =message; | |
| if(battery.charging) { | |
| if (classes.contains('charging') === false) { | |
| classes.add('charging'); | |
| classes.remove('not-charging'); |
This file contains hidden or 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 canvas = document.createElement('canvas'); | |
| canvas.width = 640; | |
| canvas.height = 480; | |
| var ctx = canvas.getContext('2d'); | |
| var video = document.querySelector(".html5-video-container > video"); | |
| ctx.drawImage(video, 0, 0, canvas.width, canvas.height); | |
| var dataURI = canvas.toDataURL('image/jpeg'); | |
| console.log(dataURI); |
This file contains hidden or 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 name="description" content="ASIN GRABBER"> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
| <script src="https://code.jquery.com/jquery-2.2.4.js"></script> |
This file contains hidden or 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
| select * from wp_posts where match(post_title, post_content) AGAINST ('best iphone to buy') | |
| #ALTER TABLE wp_posts ADD FULLTEXT(post_title, post_content) |
This file contains hidden or 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
| select wp.ID, wpm.meta_value from wp_posts wp INNER JOIN `wp_postmeta` wpm ON wp.ID = wpm.`post_id` | |
| WHERE wp.`post_type` = 'product' AND wpm.`meta_key`='_amzASIN' |