Skip to content

Instantly share code, notes, and snippets.

View vvuwei's full-sized avatar
🌁
Relax and create

Alexander vvuwei

🌁
Relax and create
View GitHub Profile
function addSubtract(param) {
let total = param;
let sign = 1;
function addSubLocal(p) {
total += p * sign;
sign *= -1;
return addSubLocal;
}

So, you want to send a motherfucking XMLHttpRequest (XHR, or commonly and falsly known as AJAX.) Too bad, just ran out of motherfucking XMLHttpRequests; but I still have one regular. XHR is not magic. It does not autofuckinmagically send things the way you want them do be sent. It does not do the thinking for you. It just sends an Http Request.

You get a hold on such a prime beast like this:

So, you want to send a motherfucking XMLHttpRequest (XHR, or commonly and falsly known as AJAX.) Too bad, just ran out of motherfucking XMLHttpRequests; but I still have one regular. XHR is not magic. It does not autofuckinmagically send things the way you want them do be sent. It does not do the thinking for you. It just sends an Http Request.

You get a hold on such a prime beast like this:

@vvuwei
vvuwei / JetBrains-IDEs-x64.vmoptions
Last active April 12, 2018 13:30
Performance tuning parameters for any IDE from JetBrains (e.g. IntelliJ IDEA, Rider, DataGrip, PhpStorm). Add these params in {__IDE_NAME__}64.exe.vmoptions or {__IDE_NAME__}.exe.vmoptions file in `~\.{__IDE__NAME_WITH_VERSION__}\config\`.
# Custom JetBrains IDE VM Options
# by Lavysh
-ea
-server
-Xms768m
-Xmx2G
-Xss16m
(function (e, s) {
var $;
e.src = s;
e.onload = function () {
jQuery.noConflict();
console.log('jQuery injected');
$ = jQuery;
run();
@vvuwei
vvuwei / php7-fpm_xdebug_nginx.md
Created August 25, 2017 00:02 — forked from rahilwazir/php7-fpm_xdebug_nginx.md
Quick guide to setup Nginx with PHP7-FPM and XDebug

PHP7

  • Ubuntu 16.04+
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt update
$ sudo apt install nginx php7.1-fpm php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-phpdbg php7.1-mbstring php7.1-gd php7.1-imap php7.1-ldap php7.1-pgsql php7.1-pspell php7.1-recode php7.1-soap php7.1-tidy php7.1-dev php7.1-intl php7.1-curl php7.1-zip php7.1-xml php-xdebug
@vvuwei
vvuwei / pagespeed.nc
Created July 12, 2017 15:59
Nginx Module. Path: mods/pagespeed.nc
##
# Pagespeed main settings
pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
# Ensure requests for pagespeed optimized resources go to the pagespeed
# handler and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
@vvuwei
vvuwei / gist:f47f8cd9771fe693c961b02c47fa2bda
Created May 1, 2017 22:07 — forked from fabriceleal/gist:7803969
Decent enough macro for exporting csvs from Excel.
' http://support.microsoft.com/kb/291296/en-us
' http://superuser.com/questions/130592/how-do-you-force-excel-to-quote-all-columns-of-a-csv-file
' - change integer to long indexing
' http://stackoverflow.com/questions/2524703/save-text-file-utf-8-encoded-with-vba
' - output utf8 content
Sub QuoteCommaExport()
' Dimension all variables.
Dim DestFile As String
Dim FileNum As Integer
@vvuwei
vvuwei / download-opensans.sh
Created March 20, 2017 13:20 — forked from JamieMason/download-opensans.sh
Download all OpenSans fonts from Google Fonts
#!/usr/bin/env bash
wget -O src/assets/web-fonts/opensans/opensans-light_cyrillic-ext_normal_300 https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTQ7aC6SjiAOpAWOKfJDfVRY.woff2
wget -O src/assets/web-fonts/opensans/opensans-light_cyrillic_normal_300 https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTRdwxCXfZpKo5kWAx_74bHs.woff2
wget -O src/assets/web-fonts/opensans/opensans-light_greek-ext_normal_300 https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTZ6vnaPZw6nYDxM4SVEMFKg.woff2
wget -O src/assets/web-fonts/opensans/opensans-light_greek_normal_300 https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTfy1_HTwRwgtl1cPga3Fy3Y.woff2
wget -O src/assets/web-fonts/opensans/opensans-light_vietnamese_normal_300 https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTfgrLsWo7Jk1KvZser0olKY.woff2
wget -O src/assets/web-fonts/opensans/opensans-light_latin-ext_normal_300 https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTYjoYw3YTyktCCer_ilOlhE.woff2
wget -O src/as