Skip to content

Instantly share code, notes, and snippets.

View arn-ob's full-sized avatar
☠️
__worker__

Arnob arn-ob

☠️
__worker__
View GitHub Profile
@sagar290
sagar290 / console.sql
Last active September 17, 2023 16:30
Resetting Auto-Incrementing IDs in PostgreSQL
DO
$$
DECLARE
rec RECORD;
lastId INT;
BEGIN
FOR rec IN (SELECT table_name
FROM information_schema.tables
WHERE table_schema = (SELECT current_schema())
AND table_type = 'BASE TABLE')
@veekaybee
veekaybee / normcore-llm.md
Last active July 21, 2024 13:28
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@sarim
sarim / MonsterMessages.go
Created December 23, 2020 01:01
Adventofcode 2020.19
package main
import (
"bufio"
"fmt"
"os"
"regexp"
"strconv"
"strings"
"time"
@vaughany
vaughany / create-csv.sh
Created July 27, 2020 08:03
Little bash script to create a CSV file containing many thousands of fake (but valid) URLs.
#!/bin/bash
# Each 'run' generates 10 unique URLs, so if RUNS=10 you'll get 100 lines out.
# Requires `gpw` to be installed, as a source for nice, random strings.
FILE=large-test.csv
RUNS=10000
if test -f "$FILE"; then
truncate -s 0 $FILE
@sudkumar
sudkumar / channels.tsx
Last active June 1, 2024 09:45
Web-Sockets in ReactJS with PusherJs and Laravel Echo with public and private channels
import React, { useEffect, useState, useMemo } from "react"
import Echo from "laravel-echo"
import Pusher from "pusher-js"
/**
* Pusher configuration
*/
const pusherConfig = {
key: '<your_pusher_key_here>',
cluster: '<pusher_cluster>',
@mortezashojaei
mortezashojaei / OrdersComponent.tsx
Last active July 11, 2024 11:04
Using laravel-echo in reactjs
import React, { FC } from 'react';
import { useSocket } from '@myapp/hooks';
import {Order} from '@myapp/models';
export const OrdersComponent: FC = () => {
const [orders,setOrders] = useState<Order[]>();
function addNewOrder(neworder:Order) {
@stancl
stancl / deploy.sh
Last active July 7, 2024 03:12
Deploy using GitHub actions and SSH to a VPS
#!/bin/sh
set -e
vendor/bin/phpunit
npm run prod
git add .
(git commit -m "Build frontend assets for deployment to production") || true
(git push) || true
1 . cd c:/program files/docker/docker
.\dockercli -Version
TO check the CLI vrsion
2. docker image ls - List out the images from docker host
3. docker container ls - list out the active container
4. docker system info
5. docker-compose --version
6. docker-machine --version
7. notary --version
8. docker container run -it ubuntu:latest /bin/bash
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active July 22, 2024 05:09
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@azu
azu / electron.yml
Created September 17, 2019 12:02
Electron Release workflow for GitHub Actions
name: Electron CD
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}