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
import { defineConfig } from "vite"; | |
function getDirFromAsset(assetInfo) { | |
if(!assetInfo.name){ | |
return "assets" | |
} | |
else if (assetInfo.name.endsWith("css")) { | |
return "css"; | |
} else if (assetInfo.name.endsWith("js")) { | |
return "js"; |
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
class StateHistory{ | |
historyIndex = 0; | |
initialState = {num: 1}; | |
stateHistory = [this.initialState]; | |
setState(fn){ | |
this.stateHistory = [...this.stateHistory, fn(this.stateHistory[this.historyIndex])]; | |
this.historyIndex++; | |
} |
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 ( | |
"fmt" | |
"time" | |
) | |
type EventType interface { | |
AddEventListener(string, func(interface{})) | |
Trigger(string, interface{}) |
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 chromeStoragePolyfill = function (dbName) { | |
const STORAGE_PREFIX = "CHROME_STORAGE_API_WRAPPER_DB"; | |
let __db__; | |
const _getData = () => { | |
const jsonData = window.localStorage.getItem(__db__); | |
if (jsonData) { | |
return JSON.parse(jsonData); | |
} | |
}; |
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="Color Palater"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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' |
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
<!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
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
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'); |
NewerOlder