Skip to content

Instantly share code, notes, and snippets.

View DirectUpload.vue
<template lang='pug'>
div.drop-zone(:class='{dragging: isDragging }'
@dragover.prevent='dragover'
@dragenter.prevent='dragover'
@drop.prevent.stop='onDrop'
@dragleave.prevent='dragleave')
div(:class='{ hidden: uploadInProgress }' @click='openFileBrowser')
slot
i {{label}}
input(type='file' :multiple='multiple' ref='input' style='display: none')
@jamesy0ung
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
1C20K-4Z214-H84U1-T92EP-92838
1A2JU-DEH12-48460-CT956-AC84D
MC28R-4L006-484D1-VV8NK-C7R58
5C6TK-4C39J-48E00-PH0XH-828Q4
4A4X0-69HE3-M8548-6L1QK-1Y240
VMware vSphere with Operations Management 6 Enterprise
4Y2NU-4Z301-085C8-M18EP-2K8M8
View nix-multi.md

Multi user nix installation

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

Install nix single user

As $USER

curl https://nixos.org/nix/install | sh
@chengkiang
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
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('https://olympics.com/tokyo-2020/olympic-games/en/results/all-sports/medal-standings.htm').then(res => res.text()).then(text => {
@karthikkondagalla
karthikkondagalla / string.cc
Created Aug 27, 2017
Manual String class implementation in C++
View string.cc
#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
soheilhy / nginxproxy.md
Last active Aug 4, 2021
How to proxy web apps using nginx?
View nginxproxy.md

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 example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

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

@shaps80
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
View initial-system-setup.md

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

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

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

2 Установка nodejs

  1. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
  2. source ~/.bashrc