Skip to content

Instantly share code, notes, and snippets.

View nick-kravchenko's full-sized avatar
🇺🇦

Nick nick-kravchenko

🇺🇦
View GitHub Profile
@nick-kravchenko
nick-kravchenko / readme.md
Created October 10, 2024 05:53
js array types
Typed Array Element Size (Bytes) Range (Min) Range (Max)
Uint8Array 1 0 255
Int8Array 1 -128 127
Uint16Array 2 0 65,535
Int16Array 2 -32,768 32,767
Uint32Array 4 0 4,294,967,295
Int32Array 4 -2,147,483,648 2,147,483,647
Float32Array 4 ±1.2 × 10^-38 ±3.4 × 10^38
Float64Array 8 ±5.0 × 10^-324 ±1.8 × 10^308
INSERT INTO classicmangos.npc_vendor (`entry`, `item`, `maxcount`, `incrtime`, `condition_id`)
VALUES
(30013, 19375, 0, 0, 0),
(30013, 19132, 0, 0, 0),
(30013, 12752, 0, 0, 0),
(30013, 19370, 0, 0, 0),
(30013, 14152, 0, 0, 0),
(30013, 14154, 0, 0, 0),
(30013, 19145, 0, 0, 0),
(30013, 14153, 0, 0, 0),
@nick-kravchenko
nick-kravchenko / nginx-latest.sh
Created July 31, 2018 13:22 — forked from gdarko/nginx-latest.sh
Install the latest nginx from source for Debian 8
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" | tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/debian/ jessie nginx" | tee -a /etc/apt/sources.list
@nick-kravchenko
nick-kravchenko / react-redux-container-template.js
Created July 20, 2018 11:47 — forked from sseletskyy/react-redux-container-template.js
React Redux Container Component Webstorm/PHPStorm File Template
import React, { PropTypes, Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
// Import actions here!!
class $NAME extends Component {
constructor(props, context) {
super(props, context);
}
@nick-kravchenko
nick-kravchenko / .htaccess
Last active March 21, 2017 13:14
Deny acces for config files
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
Order Allow,Deny
Deny from all
</FilesMatch>
function krava_insert_attachment( $file_handler, $post_id, $setthumb = 'false' ){
// check to make sure its a successful upload
if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false();
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
require_once(ABSPATH . "wp-admin" . '/includes/file.php');
require_once(ABSPATH . "wp-admin" . '/includes/media.php');
$attach_id = media_handle_upload( $file_handler, $post_id );
if ($setthumb) update_post_meta( $post_id, '_thumbnail_id', $attach_id );
;(function($){
$(document).ready(function(){
$('<button type="button" class="dec">-</button>').prependTo( inputWrapper );
$('<button type="button" class="inc">+</button>').appendTo( inputWrapper );
$( inputWrapper ).on('click', 'button', function(){
if ( !$(this).parent().find('>input[type="number"]').val() ) {
var val = 0;
} else {
var val = parseInt($(this).parent().find('>input[type="number"]').val());
}