Skip to content

Instantly share code, notes, and snippets.

View steveebenezer's full-sized avatar

Steve Ebenezer Paul steveebenezer

View GitHub Profile
@alienzhou
alienzhou / mk-openssl-webassembly.sh
Created November 28, 2021 16:49
Creates OpenSSL as WASM
#!/bin/sh
OPENSSL="openssl-1.1.1d"
if [ -d ${OPENSSL} ]; then
rm -rf ${OPENSSL}
fi
if [ ! -f ${OPENSSL}.tar.gz ]; then
curl -O https://www.openssl.org/source/${OPENSSL}.tar.gz
function hyphenize(str) {
// /y is to make sure that there are no characters between the matches
// /g is so that .match() works the way we need here
// /u is not strictly necessary here, but generally a good habit
return str.match(/([a-z]{1,2})/uyg).join('-');
}
assert.equal(
hyphenize('hello'), 'he-ll-o'
);
@Haraldson
Haraldson / usage.js
Last active March 11, 2023 13:53
Lodash useDebounce React Hook
import React, { useState, useEffect } from 'react'
import { useDebounce } from './use-debounce'
const MySearchComponent = props => {
const [search, setSearch, {
signal,
debouncing
}] = useDebounce('')
const [results, setResults] = useState([])

PreloadableWorker

There's no way to <link rel=preload> a Web Worker. This fixes that.

npm i -S gist:developit/567dde2346d785b2628224fddbf6783c

<!-- workers are now just a normal script preload: -->
<link rel=preload href=/path/to/worker.js as=script crossorigin>
@bumbeishvili
bumbeishvili / .block
Last active April 9, 2021 20:33
Organizational chart using d3.v5
license: mit
@bradtraversy
bradtraversy / docker_wordpress.md
Last active March 9, 2026 13:00
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@nadavrot
nadavrot / Matrix.md
Last active April 27, 2026 18:16
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@DesaiNikul
DesaiNikul / .block
Created March 12, 2018 21:27
D3 Org Chart Example
license: mit

Adding Google Sign In With Rails and React

For this blog post we will be using ruby version 2.4.0 and rails version 5.1.4 as backend and React/Redux as frontend. Adding Google Sign in functionality in your application can be done in two popular ways.

  • Adding google sign in functionality in the frontend with google api client gapi.

  • Adding google sign in functionality logic in the backend server.

If your application has separate backendend with APIs feeding data to the frontend React application, I suggest you to follow the step 2. If you want yo enhance your application security, then you implement both.

@earlonrails
earlonrails / HourGlass.js
Last active July 2, 2018 12:11
Solution to 2D array problem from hackerrank in ES6 - https://www.hackerrank.com/challenges/2d-array/problem
#!/usr/bin/env node
// https://www.hackerrank.com/challenges/2d-array/problem
class HourGlass {
constructor(attrs, debug) {
this.attrs = attrs
this.debug = debug
this.value = this.compute()
}