Skip to content

Instantly share code, notes, and snippets.

@uxder
uxder / GenerateClient.ts
Created July 4, 2024 01:00 — forked from anthonyjoeseph/GenerateClient.ts
Typescript React + Express SSR
import serialize from 'serialize-javascript';
import path from 'path';
import fs from 'fs';
import React from 'react';
import ReactDOMServer from 'react-dom/server';
export default <P>(
App: React.ReactElement<P>,
globalState: string | undefined,
): Promise<string> => new Promise((resolve, reject) => {
@uxder
uxder / VSCode Internal Commands
Created June 10, 2021 18:05 — forked from skfarhat/VSCode Internal Commands
List of VSCode commands
--------------------------------------------
Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.5.0
-------------------------------------------
@uxder
uxder / overflow.js
Created July 24, 2020 20:22
Debug Overflow issues for sticky
let parent = document.querySelector('.sticky-element').parentElement;
while (parent) {
const hasOverflow = getComputedStyle(parent).overflow;
if(hasOverflow !== 'visible') {
console.log(hasOverflow, parent);
}
parent = parent.parentElement;
}
@uxder
uxder / overflow.js
Created July 24, 2020 20:22
Debug Overflow issues for sticky
let parent = document.querySelector('.sticky-element').parentElement;
while (parent) {
const hasOverflow = getComputedStyle(parent).overflow;
if(hasOverflow !== 'visible') {
console.log(hasOverflow, parent);
}
parent = parent.parentElement;
}
@uxder
uxder / ExternalLink.ts
Created March 26, 2020 20:35
TUI Editor External Link Plugin
@uxder
uxder / sass
Created October 1, 2019 21:53
Fluid Mixn
//
// A mixin to scale any property based on the current viewport with
// min and max values.
// +fluid(font-size, 300px, 500px, 12px, 30px)
// +fluid(padding-left, 200px, 600px, 14px, 40px)
// +fluid(height, 200px, 600px, 140px, 400px)
//
@function strip-unit($value)
@return $value / ($value * 0 + 1)
import { MouseTracker } from './mousetracker';
/**
* A class that creates a parallax effect based on the mouse position.
* @hidden
*/
export class Parallaxer {
private animate_: boolean;
import { MouseTracker } from './mousetracker';
/**
* A class that creates a parallax effect based on the mouse position.
* @hidden
*/
export class Parallaxer {
private animate_: boolean;
# Delete all branches that contain 'search_keyword'
git branch | grep 'search_keyword' | xargs git branch -D
# Delete all branches that have already merged into master or staging
git branch --merged | egrep -v "(^\*|master|staging)" | xargs git branch -D
@uxder
uxder / mathf.js
Last active May 23, 2019 03:49
Mathf Temp
const mathf = {
getRandom : (min, max) => {
return Math.random() * (max - min) + min;
},
getRandomInt : (min, max)=>{
return Math.floor(Math.random() * (max - min + 1)) + min;