Skip to content

Instantly share code, notes, and snippets.

View Khaledgarbaya's full-sized avatar
😃
Smile

Khaled Garbaya Khaledgarbaya

😃
Smile
View GitHub Profile
@Khaledgarbaya
Khaledgarbaya / encoding-video.md
Created January 4, 2023 21:25 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@Khaledgarbaya
Khaledgarbaya / coc-settings.json
Created January 19, 2021 17:29
My nvim, tmux and coc config
{
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact",
"typescript.tsx",
"graphql"
@Khaledgarbaya
Khaledgarbaya / Extract frame from each video inside a directory using ffmpeg.md
Last active January 8, 2021 23:47
Extract frame from each video inside a directory using ffmpeg
@Khaledgarbaya
Khaledgarbaya / Refersh netlify identity.md
Created January 8, 2021 11:45
Refersh netlify identity
netlifyIdentity.on('init', (user) => {
    if (user) {
      user.jwt(true).then((token) => {
        const parts = token.split('.')
        const currentUser = JSON.parse(atob(parts[1]))
        setUser((user) => ({
          ...user,
          app_metadata: {
 ...currentUser.app_metadata,
@Khaledgarbaya
Khaledgarbaya / schduled_actions.js
Created June 9, 2020 07:27
Contentful management raw request example
// Get Scheduled actions
const contentful = require('contentful-management')
const spaceId = 'enter-your-space-id-here'
const accessToken = 'enter-your-access-token-here'
const envId = 'master'
const entryId = 'enter-entry-id-here'
const client = contentful.createClient({
accessToken: accessToken
})
@Khaledgarbaya
Khaledgarbaya / gatsby-contentful-recipe.mdx
Last active October 27, 2021 15:46
Gatsby Contentful Recipe

Setup Gatsby with Contentful

Contentful A content platform is everything a CMS isn’t. Control all of your content from a single hub. Publish to any digital channel. Integrate anything with our industry-leading app framework. See ya, CMS.


Install necessary NPM packages

@Khaledgarbaya
Khaledgarbaya / postcss.config.js
Last active April 28, 2020 12:08
Gatsby Tailwincss Recipe
module.exports = {
plugins: [require("tailwindcss"), require("autoprefixer")],
}

Keybase proof

I hereby claim:

  • I am khaledgarbaya on github.
  • I am kgarbaya (https://keybase.io/kgarbaya) on keybase.
  • I have a public key ASBhVb-tebXlS6w4eBfLudyXbfrw3v2ZSpgOriCLSQTmxwo

To claim this, I am signing this object:

@Khaledgarbaya
Khaledgarbaya / autonomous.txt
Created February 6, 2020 15:53 — forked from benjamincharity/autonomous.txt
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower (also reportedly fixes incorrectly reported heights).
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these
> steps thoroughly.
Reset Steps:
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
3. Release both buttons.
4. Press the down buttons until the desk beeps one more time or 20 seconds pass.
{
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact",
"typescript.tsx",
"graphql"