Skip to content

Instantly share code, notes, and snippets.

@skeptrunedev
skeptrunedev / yc-directory-scape.js
Last active August 30, 2024 10:36
YC Companies Directory Scraper (paste into console)
net::ERR_BLOCKED_BY_CLIENT
(anonymous) @ companies:18
(anonymous) @ companies:33
// i made this mini script because i am trying to collect the details of the existing public YC companies for a search demo with trieve
// with algolia, a search for "cloud storage" doesn't return Dropbox and a search for "bug monitoring" doesn't return PagerDuty, etc.
// find and build with trieve at github.com/devflowinc/trieve
// to use, navigate to https://www.ycombinator.com/companies and paste the following into the console
const sleepPromise = (ms) => {
@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 November 8, 2024 01:09
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 October 31, 2024 18:45
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 October 30, 2024 15:34 — 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 October 6, 2024 18:56
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...');
}