Skip to content

Instantly share code, notes, and snippets.

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@abdennour
abdennour / README.md
Last active April 18, 2024 06:48
Nginx Reverse Proxy for Nexus Docker Registries

Overview

This is a solution of a common problem with Nexus Docker repositories. The administrator has to expose port for "pull", another port for "push", other ports for each hosted repository. This solution is about leveraging Nginx reverse proxy to avoid using these ports.

How it works ?

Given :

  • Nexus hostname is "nexus.example.com"
  • Nexus web port is 8081
@jannegpriv
jannegpriv / installation_steps_k3s_dashboard.md
Last active April 18, 2024 06:47
Installation steps for K3s dashboard.

Installation steps for K3s dashboard

The steps below requires that you have followed the installation steps for installing K3s on RPIs.

NOTE: The following files can be found in the following repository.

Installation steps for K3s dashboard. On master node, create a folder called dashboard:

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 18, 2024 06:45
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 18, 2024 06:45
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@ky28059
ky28059 / vercel.md
Last active April 18, 2024 06:44
Deploying to Vercel from an organization for free using GitHub actions

This gist was partially inspired by this blog about Next.js Vercel CI with GitHub actions.

The problem

An easy way to deploy and host websites for free is to use GitHub pages. If you've deployed a Next.js project to GitHub pages, you may have used a GitHub action similar to this in the past to automatically redeploy the site when a new commit is pushed:

# gh-pages-merge.yml
name: Deploy to gh-pages on merge
on:
  push:
@gsoykan
gsoykan / tensor_2_cv2.py
Created March 10, 2023 19:23
pt tensor to cv2 image
import cv2
import numpy as np
import torch
# Create a random torch tensor
tensor = torch.randn(3, 256, 256)
# Convert the tensor to a numpy array
numpy_image = tensor.numpy()
@silphendio
silphendio / frankenmerge-test.py
Last active April 18, 2024 06:40
Cutting up a llama and putting it back together
# A simple script to demonstrate the sclicing and recombination of models at runtime
# inspired by mergekit
# Sadly, it doesn't work with quantisized models.
#
# public domain - silphendio
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
import torch
model_path = 'gpt2' # huggingface name or local folder
@tatsuyasusukida
tatsuyasusukida / !README-javascript-audio.md
Last active April 18, 2024 06:40
🎵 How to record audio using the Web Audio API in JavaScript

🎵 How to record audio using the Web Audio API in JavaScript

Demo video: How to record audio using the Web Audio API in JavaScript

About this article

This article describes how to record audio using the Web Audio API in JavaScript. The related resources are shown below.