Skip to content

Instantly share code, notes, and snippets.

View DirectUpload.vue
<template lang='pug'>
div.drop-zone(:class='{dragging: isDragging }'
div(:class='{ hidden: uploadInProgress }' @click='openFileBrowser')
i {{label}}
input(type='file' :multiple='multiple' ref='input' style='display: none')
jamesy0ung / VMware vSphere 6 and 7 Licence Keys
Last active Aug 4, 2021
VMware vSphere and vCenter 6 and 7 Licence Keys
View VMware vSphere 6 and 7 Licence Keys
Obviously using these keys may be a grey area. I use them for my homelab, but there are no guarentees VMware won't sue you if you use them in a commercial environment.
VMware vSphere 6 Enterprise Plus
VMware vSphere with Operations Management 6 Enterprise

Multi user nix installation

Each section should be run as the user or as root, pay attention to which one!

Install nix single user


curl | sh
chengkiang / paynow.js
Created Apr 26, 2019
SG PayNow QR Code Generator Sample
View paynow.js
String.prototype.padLeft = function (n, str) {
if (n < String(this).length) {
return this.toString();
else {
return Array(n - String(this).length + 1).join(str || '0') + this;
function crc16(s) {
modamodamoda / index.js
Created Jul 28, 2021
Get olympic medals per capita
View index.js
// npm install node-fetch cheerio
const fetch = require('node-fetch'), cheerio = require('cheerio');
const els = ['rank', 'country', 'gold', 'silver', 'bronze', 'total', 'rbt', 'code'];
var countries = [];
var aliases = {'Chinese Taipei': 'Taiwan', 'Hong Kong, China': 'Hong Kong'};
fetch('').then(res => res.text()).then(text => {
karthikkondagalla /
Created Aug 27, 2017
Manual String class implementation in C++
#include "String.h"
#include <cstring>
#include <cstdlib>
const size_t String::npos=-1;// greatest possible value for type size_t
Function: String
Arguments: None
Description: Default constructor
Return: Nothing
View countries.js
export default [
{ id: 'AF',
name: 'Afghanistan',
continent: 'Asia',
currencyId: 'AFN',
phoneCode: '93',
flag: '🇦🇫' },
{ id: 'AX',
name: 'Åland Islands',
continent: 'Europe',
soheilhy /
Last active Aug 4, 2021
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

shaps80 / AVPlayer+Scrubbing.swift
Last active Aug 4, 2021
Enables smooth frame-by-frame scrubbing (in both directions) – similar to Apple's applications.
View AVPlayer+Scrubbing.swift
public enum Direction {
case forward
case backward
internal var player: AVPlayer?
private var isSeekInProgress = false
private var chaseTime = kCMTimeZero
private var preferredFrameRate: Float = 23.98

Первичная настройка сервера на Ubuntu 20

1 Обновление системы и установка git

  1. sudo apt update
  2. sudo apt upgrade
  3. sudo apt install git

2 Установка nodejs

  1. curl -o- | bash
  2. source ~/.bashrc