Skip to content

Instantly share code, notes, and snippets.

@caillou
caillou / readme.md
Created August 23, 2023 18:29
Next.js App Router with supabase.signInWithOAuth()

Next.js App Router with supabase.signInWithOAuth()

Client-Side

'use client';

import { createClientComponentClient } from '@supabase/auth-helpers-nextjs';

const getURL = () => {
@dabit3
dabit3 / marketplace.sol
Last active March 14, 2024 15:55
NFT Marketplace Smart Contract (V2)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
contract NFTMarketplace is ERC721URIStorage {
@jessarcher
jessarcher / dslr-webcam.md
Last active March 10, 2024 17:25
Using my Canon 70D DSLR camera as a web cam on Linux

You'll need:

  1. Video 4 Linux loopback device kernel module (v4l2loopback) - Source: https://github.com/umlaeute/v4l2loopback (You might find builds in your distro's repos - I'm using Fedora so had to build it myself using https://github.com/danielkza/v4l2loopback-fedora/)
  2. gPhoto2 - this is what allows you to access your cameras live feed over USB - this was available in Fedora's repos.
  3. GStreamer or ffmpeg - this is what lets you stream the output from gPhoto2 into the loopback device.

It's been a little while since I set it all up so I can't remember all of the installation details, which will probably be different for your distro anyway unless you're using Fedora. Apologies if I have forgotten something as wel.

Running the stream

@Yatoom
Yatoom / setup.md
Last active April 19, 2024 06:41
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@ereli
ereli / countries.sql
Last active March 28, 2024 06:40 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes. PostgreSQL compatible
CREATE SEQUENCE country_seq;
CREATE TABLE IF NOT EXISTS country (
id int NOT NULL DEFAULT NEXTVAL ('country_seq'),
iso char(2) NOT NULL,
name varchar(80) NOT NULL,
nicename varchar(80) NOT NULL,
iso3 char(3) DEFAULT NULL,
numcode smallint DEFAULT NULL,
phonecode int NOT NULL,
@gyribeiro
gyribeiro / tmux_italic.md
Last active May 2, 2024 16:28
enable italic font on tmux
@Phlow
Phlow / nested-for-loop.liquid
Created January 6, 2017 20:08
This is a nested liquid loop for Jekyll to iterate through YAML data with a depth of three levels. The example loops through a potential table of contents of a book.
{% comment %}
#
# This is a nested liquid loop for Jekyll to iterate through YAML data with
# a depth of three levels. The example loops through a potential table of
# contents of a book.
#
# This is the example YAML content'
- chapters: 'Einführung'
sub_chapters:
@JustinBeckwith
JustinBeckwith / vision.js
Created March 18, 2016 21:12
Google Cloud Vision API with Node.js example
var gcloud = require('gcloud')({
projectId: 'my-project',
keyFilename: 'keyfile.json'
});
var vision = gcloud.vision();
vision.detectText('./image.jpg', function(err, text) {
if (text.length > 0) {
console.log('We found text on this image...');
}
@JustinBeckwith
JustinBeckwith / app.yaml
Created October 6, 2015 04:41
Using memcached for session state with express and nodejs on AppEngine
runtime: nodejs
api_version: 1
vm: true
env_variables:
PORT: 8080
MEMCACHE_URL: memcache:11211