Skip to content

Instantly share code, notes, and snippets.

@nimone
nimone / Sidebar.jsx
Created June 29, 2023 09:33
Retractable Sidebar Component purely in ReactJS and TailwindCSS
import { MoreVertical, ChevronLast, ChevronFirst } from "lucide-react"
import { useContext, createContext, useState } from "react"
const SidebarContext = createContext()
export default function Sidebar({ children }) {
const [expanded, setExpanded] = useState(true)
return (
<aside className="h-screen">
@jeroen-meijer
jeroen-meijer / fluttercleanrecursive.sh
Created September 15, 2019 13:00
Flutter Clean Recursive - Clear up space on your hard drive by cleaning your Flutter projects. This script searches for all Flutter projects in this directory and all subdirectories and runs 'flutter clean'. Note: may take a long time for folders with large amounts of projects.
#!/bin/sh
# To run, download the script or copy the code to a '.sh' file (for example 'fluttercleanrecursive.sh') and run like any other script:
# sh ./fluttercleanrecursive.sh
# or
# sudo sh fluttercleanrecursive.sh
echo "Flutter Clean Recursive (by jeroen-meijer on GitHub Gist)"
echo "Looking for projects... (may take a while)"
@gasolin
gasolin / gist:9300f5f9276b2df884c80da3e2c54ffc
Last active July 15, 2023 10:13
Install Android Simulator

Install Android SDK on macOS

Install homebrew https://brew.sh/

brew cask install adoptopenjdk8
brew cask install android-sdk
@stevenringo
stevenringo / reinvent-2017-youtube.md
Created December 3, 2017 23:01
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description

@arun-gupta
arun-gupta / readme.adoc
Last active March 22, 2020 12:21
Kubernetes Cluster on AWS
  1. kops: https://github.com/kubernetes/kops

    1. Getting Started Guide: https://github.com/kubernetes/kops/blob/master/docs/aws.md

    2. Installing Kubernetes on AWS with kops: https://kubernetes.io/docs/getting-started-guides/kops/

    3. Mulit-master Kubernetes Cluster on AWS with kops: http://blog.arungupta.me/multimaster-kubernetes-cluster-amazon-kops/

    4. Booting Kubernetes on Amazon Elastic Compute with kops: https://deis.com/docs/workflow/quickstart/provider/aws/boot/

    5. Setting up an HA Kubernetes Cluster in AWS with private topology with kops 1.5.1: https://www.nivenly.com/kops-1-5-1/

    6. Kubernetes on AWS: https://daemonza.github.io/2017/01/15/kubernetes-on-aws/

    7. Your 2nd day with Kubernetes on AWS: https://www.nivenly.com/2nd-hour/

  2. Tectonic (Terraform): http://github.com/coreos/tectonic-installer

@duggan
duggan / inventory.py
Created October 12, 2015 15:01
Present Terraform tfstate data as an Ansible inventory
#!/usr/bin/env python
import sys
import os
import json
import argparse
import collections
__description__ = """Ansible Dynamic Inventory for Terraform."""
__epilog__ = """
@cridenour
cridenour / gist:74e7635275331d5afa6b
Last active August 7, 2023 13:52
Setting up Vim as your Go IDE

Setting up Vim as your Go IDE

The final IDE

Intro

I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.

Getting Started

I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.

@kevingessner
kevingessner / gist:9509148
Last active April 27, 2023 15:45
Responsive emails that really work -- From Etsy's Code As Craft blog: http://codeascraft.com/2014/03/13/responsive-emails-that-really-work
<html>
<head>
<style type="text/css">
table table {
width: 600px !important;
}
table div + div { /* main content */
width: 65%;
float: left;
}
awk '/^(\S+) \S+ \S+ \[([^\]]+)\] "([A-Z]+)[^"]*" \d+ \d+ "[^"]*" "([^"]*)"$/m ($6 == "\"GET") && ($9 == 200) && !($7 ~ /^\/_analytics/) && !($7 ~ /^\/arama/) && !($7 ~ /^\/programlar\?q/) && !($7 ~ /^\/uzmanlar\?search/) && !($7 ~ /^\/app\/vplayer\/getsibling.tv/) {print $7}' access.log | uniq > access_log_filtered.log
@rothgar
rothgar / main.yml
Last active March 8, 2024 07:16
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']