Skip to content

Instantly share code, notes, and snippets.

View iftkharhussain's full-sized avatar

Iftikhar Hussain iftkharhussain

View GitHub Profile
@antishok
antishok / index.js
Created August 18, 2019 21:11
express-ws session example
const path = require('path');
const express = require('express');
const expressWs = require('express-ws');
const bodyParser = require('body-parser');
const expressSession = require('express-session');
const KnexSessionStore = require('connect-session-knex')(expressSession);
const passport = require('passport');
const app = express();
@fstanis
fstanis / audio2waveform.html
Last active March 7, 2023 01:42
Demo on creating SVG waveforms from an audio file.
<!--
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
import React, { Component } from 'react';
import { View, TouchableOpacity } from 'react-native';
import _ from 'lodash';
import { scaleLinear } from 'd3-scale';
import { mean } from 'd3-array';
const ACTIVE = '#FF1844',
INACTIVE = '#424056',
ACTIVE_PLAYABLE = '#1b1b26'
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active January 9, 2025 12:22
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@schneidmaster
schneidmaster / MaskedInput.js
Created January 28, 2016 19:44
react-bootstrap + react-maskedinput
import React from 'react';
import classNames from 'classnames';
import { Input } from 'react-bootstrap';
import MaskedInputField from 'react-maskedinput';
export default class MaskedInput extends Input {
renderInput() {
const className = this.isCheckboxOrRadio() || this.isFile() ? '' : 'form-control';
return <MaskedInputField {...this.props} className={classNames(this.props.className, className)} ref="input" key="input" />;
}
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/