Skip to content

Instantly share code, notes, and snippets.

View andymerskin's full-sized avatar
Wizarding

Andy Merskin andymerskin

Wizarding
View GitHub Profile
@kutnickclose
kutnickclose / cypress_launcdarkly.ts
Last active January 26, 2022 18:23
Cypress + Launchdarkly
// all code in cypress/support/commands.ts
// Convert this file to a module for global namespace declaration
export {};
declare global {
namespace Cypress {
interface Chainable {
/**
* Custom command to set launchdarkly feature flag values.
* @example cy.updateFeatureFlags({ 'flag-name': false})
@Venryx
Venryx / Example.tsx
Last active February 9, 2023 22:36
Using "useImperativeHandle" in a React functional component, with automatic TypeScript typing
import {forwardRef, useImperativeHandle, ForwardRefExoticComponent, RefAttributes, Ref} from "react";
export type Handle<T> = T extends ForwardRefExoticComponent<RefAttributes<infer T2>> ? T2 : never;
export const Parent = (props: {})=> {
let childHandle: Handle<typeof Child>;
return (
<div onClick={()=>childHandle.SayHi()}>
<Child name="Bob" ref={c=>childHandle = c}/>
</div>
@k06a
k06a / install-ffmpeg-with-h265.sh
Last active March 9, 2021 15:51
H265 with ffmpeg
# Installing ffmpeg with H265 support
brew tap varenc/ffmpeg
brew install varenc/ffmpeg/ffmpeg --with-fdk-aac --HEAD
# Installing mp4edit tool
brew install bento4
@rmp135
rmp135 / loadAllComps.js
Last active September 6, 2021 11:32
Import all vue components in a directory
// Use the following to load all vue components in a directory. They will be loaded by the `name` attribute.
components: {
...(() => {
const context = require.context("./components", false, /.*.vue/);
return Object.fromEntries(
context
.keys()
.map(k => context(k).default)
.filter(c => c.name != undefined)
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active September 22, 2024 17:43
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active September 15, 2024 10:33
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: