Skip to content

Instantly share code, notes, and snippets.

@swyxio
swyxio / Tailwindcssunreset.scss
Last active February 14, 2024 01:19
Tailwind CSS Un-Reset - un-reset Tailwind's Preflight CSS Reset so that autogenerated HTML looks consistent with the rest of your Tailwind site. - https://www.swyx.io/writing/tailwind-unreset
.unreset {
a {
@apply text-blue-700 underline;
}
p {
@apply my-4;
}
blockquote,
figure {
@ConnorGriffin
ConnorGriffin / GDrive.Download.ps1
Created September 4, 2018 05:37
Download files from Google Drive, converting to specific MIME types if necessary
# Set the Google Auth parameters. Fill in your RefreshToken, ClientID, and ClientSecret
$params = @{
Uri = 'https://accounts.google.com/o/oauth2/token'
Body = @(
"refresh_token=$RefreshToken", # Replace $RefreshToken with your refresh token
"client_id=$ClientID", # Replace $ClientID with your client ID
"client_secret=$ClientSecret", # Replace $ClientSecret with your client secret
"grant_type=refresh_token"
) -join '&'
Method = 'Post'
@exAspArk
exAspArk / curl.sh
Last active May 1, 2024 03:59
Test CORS with cURL
curl -I -X OPTIONS \
-H "Origin: http://EXAMPLE.COM" \
-H 'Access-Control-Request-Method: GET' \
http://EXAMPLE.COM/SOMETHING 2>&1 | grep 'Access-Control-Allow-Origin'
@shanealynn
shanealynn / python batch geocoding.py
Last active January 6, 2024 13:48
Geocode as many addresses as you'd like with a powerful Python and Google Geocoding API combination
"""
Python script for batch geocoding of addresses using the Google Geocoding API.
This script allows for massive lists of addresses to be geocoded for free by pausing when the
geocoder hits the free rate limit set by Google (2500 per day). If you have an API key for paid
geocoding from Google, set it in the API key section.
Addresses for geocoding can be specified in a list of strings "addresses". In this script, addresses
come from a csv file with a column "Address". Adjust the code to your own requirements as needed.
After every 500 successul geocode operations, a temporary file with results is recorded in case of
script failure / loss of connection later.
Addresses and data are held in memory, so this script may need to be adjusted to process files line
@leonardofed
leonardofed / README.md
Last active May 3, 2024 01:24
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@santisbon
santisbon / Update-branch.md
Last active March 21, 2024 15:50
Deploying from #Git branches adds flexibility. Bring your feature branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master.

@aws-scripting-guy
aws-scripting-guy / gist:884ffa9d44bd14f7493a670543284552
Created April 2, 2016 18:33
AWS EC2 metadata. Check attached IAM role from EC2 instance. Get temporary credentials.
# Get IAM Role name from Instance Profile Id
curl http://169.254.169.254/latest/meta-data/iam/info
# Get credentials
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name>
# More info
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
package eval
import scala.reflect.runtime.currentMirror
import scala.tools.reflect.ToolBox
import java.io.File
object Eval {
def apply[A](string: String): A = {
val toolbox = currentMirror.mkToolBox()