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 { BrowserWindow } = require( 'electron' ); | |
const defaultProps = { | |
width: 1024, | |
height: 640, | |
webPreferences: { nodeIntegration: true }, | |
show: false | |
}; | |
class Window extends BrowserWindow { |
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
kconst elementIsVisibleInViewport = (el, partiallyVisible = false) => { | |
const { top, left, bottom, right } = el.getBoundingClientRect(); | |
const { innerHeight, innerWidth } = window; | |
return partiallyVisible | |
? ((top > 0 && top < innerHeight) || (bottom > 0 && bottom < innerHeight)) && | |
((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth)) | |
: top >= 0 && left >= 0 && bottom <= innerHeight && right <= innerWidth; | |
}; |
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 arrayToCSV = (arr, delimiter = ',') => | |
arr.map(v => v.map(x => `"${x}"`).join(delimiter)).join('\n'); |
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
/** | |
* In: . Out: 2018 | |
* In: 2018. Out: 2018 | |
* In: 2013. Out: 2013-18 | |
* In: 1998. Out: 1998-2018 | |
* | |
* @param string $year | |
* @return string | |
*/ | |
function get_website_year_start( $year ) { |
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 UNIDADES = new Array( "", "un", "dos", "tres", "cuatro", "cinco", "seis", "siete", "ocho", "nueve", "diez", "once", "doce", "trece", "catorce", "quince", "dieciséis", "diecisiete", "dieciocho", "diecinueve", "veinte", "veintiuno", "veintidos", "veintitres", "veinticuatro", "veinticinco", "veintiseis", "veintisiete", "veintiocho", "veintinueve" ); | |
var DECENAS = new Array( "", "diez", "veinte", "treinta", "cuarenta", "cincuenta", "sesenta", "setenta", "ochenta", "noventa", "cien" ); | |
var CENTENAS = new Array( "", "ciento", "doscientos", "trescientos", "cuatrocientos", "quinientos", "seiscientos", "setecientos", "ochocientos", "novecientos" ); | |
function numero2LetrasRecursivo( numero ) { | |
var resultado = ""; | |
switch( true ) { | |
case( numero == 0 ): | |
resultado = "cero"; | |
break; |
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
$string = "Hello World"; | |
$encrypted = oro_encrypt_string( $string ); | |
$decrypted = oro_decrypt_string( $encrypted ); | |
echo $string . '<br />' . $encrypted . '<br />' . $decrypted; | |
function oro_encrypt_string( $string, $key = '', $iv = '', $method = '' ) { | |
$encrypt_method = empty( $method ) ? 'AES-256-CBC' : $method; | |
$secret_key = empty( $key ) ? 'random' : $key; |
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
charset "utf-8"; | |
/* CSS Document */ | |
.kek{ | |
text-shadow: 1px -1px 0 #767676, | |
-1px 2px 1px #737272, | |
-2px 4px 1px #767474, | |
-3px 6px 1px #787777, | |
-4px 8px 1px #7b7a7a, | |
-5px 10px 1px #7f7d7d, |
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
.system-font-stack { | |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif; | |
} | |
/** | |
-apple-system. is San Francisco, used on iOS and macOS (not Chrome however) | |
BlinkMacSystemFont. is San Francisco, used on macOS Chrome | |
Segoe UI. is used on Windows 10 | |
Roboto. is used on Android | |
Oxygen-Sans. is used on GNU+Linux |
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
function header_status($statusCode) { | |
static $status_codes = null; | |
if ($status_codes === null) { | |
$status_codes = array ( | |
100 => 'Continue', | |
101 => 'Switching Protocols', | |
102 => 'Processing', | |
200 => 'OK', | |
201 => 'Created', |
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 toType = function(obj) { | |
return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase() | |
} | |
toType({a: 4}); //"object" | |
toType([1, 2, 3]); //"array" | |
(function() {console.log(toType(arguments))})(); //arguments | |
toType(new ReferenceError); //"error" | |
toType(new Date); //"date" | |
toType(/a-z/); //"regexp" |