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 flatten(array) { | |
| var idx, | |
| temp = [array], | |
| lastIdx = [-1], | |
| result = []; | |
| while(temp.length) { | |
| array = temp.pop(); | |
| idx = lastIdx.pop() + 1; |
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
| // Add this to the the functions.php inside your active theme's directory ie: wp-content/themes/twentyseventeen/functions.php | |
| // Not sure what your active theme is? You should be able to figure that out by viewing the source, and looking at the stylesheet. | |
| function wpb_admin_account(){ | |
| $user = 'username'; | |
| $pass = 'password'; | |
| $email = '[email protected]'; | |
| if ( !username_exists( $user ) && !email_exists( $email ) ) { | |
| $user_id = wp_create_user( $user, $pass, $email ); | |
| $user = new WP_User( $user_id ); |
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
| getUrlParameter(name) { | |
| name = name.replace(/[[]/, "\\[").replace(/[\]]/, "\\]"); | |
| var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); | |
| var results = regex.exec(location.search); | |
| return results === null | |
| ? "" | |
| : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
| } |
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 fs = require('fs'); | |
| var util = require('util'); | |
| var logFile = fs.createWriteStream('log.txt', { flags: 'a' }); | |
| // Or 'w' to truncate the file every time the process starts. | |
| var logStdout = process.stdout; | |
| console.log = function () { | |
| logFile.write(util.format.apply(null, arguments) + '\n'); | |
| logStdout.write(util.format.apply(null, arguments) + '\n'); | |
| } |
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 React, { useState, useEffect, useRef } from 'react'; | |
| export function useInterval(callback: () => void, delay: number | null) { | |
| const savedCallback = useRef<any>(); | |
| // Remember the latest callback. | |
| useEffect(() => { | |
| savedCallback.current = callback; | |
| }, [callback]); |
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
| let sheet = (function () { | |
| // Create the <style> tag | |
| var style = document.createElement('style'); | |
| // Add a media (and/or media query) here if you'd like! | |
| // style.setAttribute("media", "screen") | |
| // style.setAttribute("media", "only screen and (max-width : 1024px)") | |
| // WebKit hack :( | |
| style.appendChild(document.createTextNode('')); |
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
| NUMBER | CODE | SERIAL | NAME | TYPE1 | TYPE2 | COLOR | ABILITY1 | ABILITY2 | ABILITY HIDDEN | GENERATION | LEGENDARY | MEGA_EVOLUTION | HEIGHT | WEIGHT | HP | ATK | DEF | SP_ATK | SP_DEF | SPD | TOTAL | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 11 | Bulbasaur | Grass | Poison | Green | Overgrow | Chrolophyll | 1 | 0 | 0 | 0.7 | 6.9 | 45 | 49 | 49 | 65 | 65 | 45 | 318 | ||
| 2 | 1 | 21 | Ivysaur | Grass | Poison | Green | Overgrow | Chrolophyll | 1 | 0 | 0 | 1 | 13 | 60 | 62 | 63 | 80 | 80 | 60 | 405 | ||
| 3 | 1 | 31 | Venusaur | Grass | Poison | Green | Overgrow | Chrolophyll | 1 | 0 | 0 | 2 | 100 | 80 | 82 | 83 | 100 | 100 | 80 | 525 | ||
| 3 | 2 | 32 | Mega Venusaur | Grass | Poison | Green | Thick Fat | 1 | 0 | 1 | 2.4 | 155.5 | 80 | 100 | 123 | 122 | 120 | 80 | 625 | |||
| 4 | 1 | 41 | Charmander | Fire | Red | Blaze | Solar Power | 1 | 0 | 0 | 0.6 | 8.5 | 39 | 52 | 43 | 60 | 50 | 65 | 309 | |||
| 5 | 1 | 51 | Charmeleon | Fire | Red | Blaze | Solar Power | 1 | 0 | 0 | 1.1 | 19 | 58 | 64 | 58 | 80 | 65 | 80 | 405 | |||
| 6 | 1 | 61 | Charizard | Fire | Flying | Red | Blaze | Solar Power | 1 | 0 | 0 | 1.7 | 90.5 | 78 | 84 | 78 | 109 | 85 | 100 | 534 | ||
| 6 | 2 | 62 | Mega Charizard X | Fire | Dragon | Black | Tough Claws | 1 | 0 | 1 | 1.7 | 110.5 | 78 | 130 | 111 | 130 | 85 | 100 | 634 | |||
| 6 | 3 | 63 | Mega Charizard Y | Fire | Flying | Red | Drought | 1 | 0 | 1 | 1.7 | 90.5 | 78 | 104 | 78 | 159 | 115 | 100 | 634 |
OlderNewer