Skip to content

Instantly share code, notes, and snippets.

View dejurin's full-sized avatar
💭
;-)

YURII D. dejurin

💭
;-)
View GitHub Profile
@dejurin
dejurin / index.html
Created November 11, 2015 12:31 — forked from mattattui/index.html
Count online users
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Pinger test</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
@dejurin
dejurin / centos_python.sh
Created December 23, 2016 20:57 — forked from selfboot/centos_python.sh
CentOS 6.8: Install Python 2.7.10, pip, virtualenv, and virtualenvwrapper on CentOS
#!/bin/bash
# According to:
# How To Set Up Python 2.7.6 and 3.3.3 on CentOS 6.4
# https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4
yum -y update
yum groupinstall -y 'development tools'
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel
yum install xz-libs
wget http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz
@dejurin
dejurin / python27_on_centos65.md
Created December 29, 2016 00:32 — forked from dalegaspi/python27_on_centos65.md
Installing Python 2.7 on CentOS 6.5

Installing Python 2.7 on Centos 6.5

Centos 6.* comes with Python 2.6, but we can't just replace it with v2.7 because it's used by the OS internally (apparently) so you will need to install v2.7 (or 3.x, for that matter) along with it. Fortunately, CentOS made this quite painless with their Software Collections Repository

sudo yum update # update yum
sudo yum install centos-release-scl # install SCL 
sudo yum install python27 # install Python 2.7

To use it, you essentially spawn another shell (or script) while enabling the newer version of Python:

@dejurin
dejurin / do.sh
Created December 18, 2017 08:24 — forked from loganlinn/do.sh
PHP strcmp+strtolower VS strcasecmp Benchmark
for i in 50 100 250 500; do echo "String length: $i"; php strcmpbench.php $i; php strcasecmpbench.php $i; echo "\n"; done
# Example run:
#
# String length: 50
# ************************
# * strcomp + strtolower *
# ************************
# Time: 0.000082
# Memory: 1456
@dejurin
dejurin / vanilla-js-cheatsheet.md
Created January 5, 2018 15:08 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@dejurin
dejurin / http-benchmark.md
Created December 15, 2019 23:12 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@dejurin
dejurin / nginx.conf
Created December 18, 2019 13:04 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@dejurin
dejurin / gist:06d979d9a04e3a283ae6b3c22d4bd650
Created May 16, 2021 22:04 — forked from supairish/gist:2951524
Nginx - how to limit requests by User Agent
http {
map $http_user_agent $limit_bots {
default '';
~*(google|bing|yandex|msnbot) $binary_remote_addr;
}
limit_req_zone $limit_bots zone=bots:10m rate=1r/m;
server {
@dejurin
dejurin / isElementInViewport.js
Created September 7, 2021 21:13 — forked from davidtheclark/isElementInViewport.js
JavaScript: Is element in viewport?
/*
No jQuery necessary.
Thanks to Dan's StackOverflow answer for this:
http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport
*/
function isElementInViewport(el) {
var rect = el.getBoundingClientRect();
return (
rect.top >= 0 &&
@dejurin
dejurin / meta-tags.md
Created September 27, 2021 20:48 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">