Skip to content

Instantly share code, notes, and snippets.

View islami00's full-sized avatar

Islam islami00

View GitHub Profile
@7468696e6b
7468696e6b / okular-appleSilicon.md
Last active July 23, 2024 17:44
how to install Okular viewer on macOS Big Sur, using M1/Apple Silicon/arm64
  1. Install homebrew from https://brew.sh/ (follow the instructions there)
  2. tap the https://invent.kde.org/packaging/homebrew-kde/ repo, brew tap kde-mac/kde https://invent.kde.org/packaging/homebrew-kde.git
  3. brew edit okular, workaround now is to comment out or delete the line depends_on "chmlib" (won't compile on macos arm64 for now as of 2021-08-18), then save (if using vim you need to first press i to insert/type, when saving then <esc> then :wq then <enter>.
  4. brew install okular, wait for stuff to compile and/or install
  5. It may ask for keychain credentials (to sign the binaries? because of mac arm64 security policy https://eclecticlight.co/2021/01/26/when-you-dont-have-permission-to-run-an-app-on-an-m1-mac/)
  6. $(brew --repo kde-mac/kde)/tools/do-caveats.sh
  7. Now okular is in your $HOME/Applications/KDE folder, and will show up in Launchpad! You can view pdf, djvu, etc documents.
@skurfuerst
skurfuerst / gen-types.mjs
Created January 16, 2021 21:10
Generate runtypes from TypeScript definitions using ts-morph
// RUN with a recent node.js version, using "node gen-types.mjs"
// DEPENDS on typescript and ts-morph
import { Project } from "ts-morph";
import { writeFileSync } from "fs";
const project = new Project({
tsConfigFilePath: "tsconfig.json",
});
@textbook
textbook / cypress-cra.md
Last active September 28, 2023 20:16
Adding Cypress to a Create React App app

Here is how to add Cypress E2E tests to a Create React App bootstrapped application. Assumes the *nix command line, you may need to adapt this for a Windows command line (or use WSL or Git Bash).

  1. Install Cypress and the Testing Library utilities for it (to match the helpers CRA installs):

    $ npm i {,@testing-library/}cypress

    i is short for install, and the braces {} are expanded by brace expansion to cypress @testing-library/cypress.

@mtilson
mtilson / _script.sh
Last active November 14, 2022 08:26
how to trigger GitHub Actions workflows in different ways [git] [github] [workflow] [webhook]
#!/usr/bin/env bash
set -e
# we are going to setup different GitHub Actions workflows on
# GitHub repo '${repoName}' under GitHub user account '${userName}'
# which has Write access to the repo
# to trigger 'webhook' event with help of 'curl' command we use
# 'Authorization' header with personal access token '${token}' which
# has to be created aforehand, see [2]
@tianhaoz95
tianhaoz95 / open-in-gitpod.md
Last active February 29, 2024 21:43
Code to add a open in Gitpod badge

Here is your awesome Open in Gitpod badge

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/[your GitHub username]/[your repository])

Open in Gitpod

@WangHansen
WangHansen / userschema.ts
Last active October 14, 2022 18:40
Convert Mongoose js to ts
import { Document, Model, model, Types, Schema, Query } from "mongoose"
import { Company } from "./Company"
// Schema
const UserSchema = Schema<UserDocument, UserModel>({
firstName: {
type: String,
required: true
},
lastName: String,
@stolinski
stolinski / providerCompose.js
Created April 23, 2019 17:40
ProviderComposer
function ProviderComposer({ contexts, children }) {
return contexts.reduceRight(
(kids, parent) =>
React.cloneElement(parent, {
children: kids,
}),
children
);
}
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active July 23, 2024 21:53
Conventional Commits Cheatsheet

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@bvaughn
bvaughn / index.md
Last active June 16, 2024 21:50
How to use profiling in production mode for react-dom

React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.

Table of Contents

Profiling in production

React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.

@jhnferraris
jhnferraris / hyper.js
Created July 3, 2018 10:38 — forked from coco-napky/hyper.js
Hyper config for git bash in Windows
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',