Skip to content

Instantly share code, notes, and snippets.

View saratonite's full-sized avatar
🏡
WFH

Sarath saratonite

🏡
WFH
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active July 7, 2024 19:42
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@mattfysh
mattfysh / client.js
Last active June 7, 2023 14:45
urql + auth-exchange + aws-amplify
import { makeOperation } from '@urql/svelte'
import { authExchange } from '@urql/exchange-auth'
import { Auth } from 'aws-amplify'
import produce from 'immer'
import { set } from 'lodash'
const amplifyAuthExchange = authExchange({
addAuthToOperation: ({ authState, operation }) => {
if (!authState?.token) {
return operation
@prologic
prologic / LearnGoIn5mins.md
Last active July 3, 2024 04:05
Learn Go in ~5mins
@sundowndev
sundowndev / GoogleDorking.md
Last active July 8, 2024 19:34
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@skyzyx
skyzyx / homebrew-gnubin.md
Last active June 29, 2024 15:22
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 3, 2024 17:43
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@v1shwa
v1shwa / dynamic_subdomains
Created March 21, 2019 13:54
Dynamically map subdomains to different ports on the server - using Nginx
server {
listen 80;
# maps p8080.example.com -> localhost:8080
server_name ~^p(?<port>[^.]+)\.example\.com$;
location / {
proxy_pass http://localhost:$port;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@connor11528
connor11528 / ScapeGreenhouse.php
Last active January 6, 2024 21:50
Artisan command to scrape jobs from Greenhouse.io
<?php
namespace App\Console\Commands;
use App\Company;
use App\JobListing;
use Illuminate\Console\Command;
use Goutte\Client;
class ScrapeGreenhouse extends Command
@saratonite
saratonite / Twitter API with Curl
Created February 13, 2018 10:06 — forked from apolloclark/Twitter API with Curl
Twitter API with Curl
# create an account, create an app
# @see https://apps.twitter.com/
# retrieve the access tokens
# @see https://dev.twitter.com/oauth/reference/post/oauth2/token
# create the file ~/twitter_api
nano ~/twitter_api
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0"
@ibraheem4
ibraheem4 / postgres-brew.md
Last active July 5, 2024 17:29 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update