Skip to content

Instantly share code, notes, and snippets.

View michaelmoussa's full-sized avatar

Michael Moussa michaelmoussa

View GitHub Profile
@jonsugar
jonsugar / show-tailwind-breakpoint.html
Last active April 19, 2024 17:31
Show current tailwind breakpoint.
<div class="flex items-center m-2 fixed bottom-0 right-0 border border-gray-400 rounded p-2 bg-gray-300 text-pink-600 text-sm">
<svg class="h-6 w-auto inline" viewBox="0 0 80 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill="url(#paint0_linear)" fill-rule="evenodd" clip-rule="evenodd" d="M32 16C24.8 16 20.3 19.6 18.5 26.8C21.2 23.2 24.35 21.85 27.95 22.75C30.004 23.2635 31.4721 24.7536 33.0971 26.4031C35.7443 29.0901 38.8081 32.2 45.5 32.2C52.7 32.2 57.2 28.6 59 21.4C56.3 25 53.15 26.35 49.55 25.45C47.496 24.9365 46.0279 23.4464 44.4029 21.7969C41.7557 19.1099 38.6919 16 32 16ZM18.5 32.2C11.3 32.2 6.8 35.8 5 43C7.7 39.4 10.85 38.05 14.45 38.95C16.504 39.4635 17.9721 40.9536 19.5971 42.6031C22.2443 45.2901 25.3081 48.4 32 48.4C39.2 48.4 43.7 44.8 45.5 37.6C42.8 41.2 39.65 42.55 36.05 41.65C33.996 41.1365 32.5279 39.6464 30.9029 37.9969C28.2557 35.3099 25.1919 32.2 18.5 32.2Z"></path>
<defs>
<linearGradient id="paint0_linear" x1="3.5" y1="16" x2="59" y2="48" gradien
@kafkasl
kafkasl / sp500_constituents.json
Created March 7, 2019 13:47
List of S&P 500 historical constituents from 2008/01/31 to 2019/02/27. JSON format where each date contains a list of the constituents.
This file has been truncated, but you can view the full file.
{
"2008/01/31":[
"GHC",
"MDP",
"GAS",
"AZO",
"MIL",
"MXA",
"ASH",
"SNA",
@dlublin
dlublin / ffmpeg-hap-readme.md
Created April 18, 2017 13:40
Encoding to Hap from the command line using FFmpeg

Encoding to Hap from the command line using FFmpeg

For users who prefer working with a command line or need to access advanced encoding settings for Hap the popular FFmpeg library can be used to work with Hap movies.

  1. If this is your first time using FFmpeg you may need to install it on your system, or compile it from source. In either case be sure that Snappy is enabled as part of the binary. If you already have FFmpeg on your system with Snappy enabled, you can skip this step.

    You can check that your version of FFmpeg can encode Hap using

    ffmpeg -encoders | grep hap
    
@ryu1kn
ryu1kn / Makefile
Last active March 19, 2023 13:02
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
KEY_ID=alias/my-key
SECRET_BLOB_PATH=fileb://my-secret-blob
SECRET_TEXT="my secret text"
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target
encrypt-text:
@lornajane
lornajane / mac.md
Last active May 1, 2024 00:31
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@pschipitsch
pschipitsch / access_policy.template
Created April 13, 2016 03:07
AWS Elasticsearch Service Access Policy Terraform Template
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": [
"es:ESHttpGet",
"es:ESHttpHead",
"es:ESHttpPost",

Whitelist the host for interactive tutorials in neo4j-server.properties file

# Whitelist of hosts for the Neo4j Browser to be allowed to fetch content from.
# Set to '*' to allow all hosts.
dbms.browser.remote_content_hostname_whitelist=http://guides.neo4j.com,https://guides.neo4j.com,http://localhost,https://localhost

Start neo4j server

@vkostyukov
vkostyukov / statuses.md
Last active February 13, 2024 21:39
HTTP status codes used by world-famous APIs
API Status Codes
[Twitter][tw] 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504
[Stripe][stripe] 200, 400, 401, 402, 404, 429, 500, 502, 503, 504
[Github][gh] 200, 400, 422, 301, 302, 304, 307, 401, 403
[Pagerduty][pd] 200, 201, 204, 400, 401, 403, 404, 408, 500
[NewRelic Plugins][nr] 200, 400, 403, 404, 405, 413, 500, 502, 503, 503
[Etsy][etsy] 200, 201, 400, 403, 404, 500, 503
[Dropbox][db] 200, 400, 401, 403, 404, 405, 429, 503, 507
@gene1wood
gene1wood / 01_get_aws_account_id.py
Last active June 22, 2018 18:44
Method to determine the AWS account ID of your account using boto
#!/usr/bin/env python
import boto, boto.jsonresponse
conn = boto.connect_sts()
e = boto.jsonresponse.Element()
boto.jsonresponse.XmlHandler(e, conn).parse(conn.make_request('GetCallerIdentity',{},'/','POST').read())
e['GetCallerIdentityResponse']['GetCallerIdentityResult']['Account']