Skip to content

Instantly share code, notes, and snippets.

View 0xDaksh's full-sized avatar
🦄
Layer 2 DeFi is going to be fun!

Daksh 0xDaksh

🦄
Layer 2 DeFi is going to be fun!
View GitHub Profile
@jnrbsn
jnrbsn / gist:4268258
Created December 12, 2012 14:40
Loads a JavaScript file asynchronously with a callback, like jQuery's `$.getScript()` except without jQuery.
function j(u, c) {
var h = document.getElementsByTagName('head')[0], s = document.createElement('script');
s.async = true; s.src = u;
s.onload = s.onreadystatechange = function () {
if (!s.readyState || /loaded|complete/.test(s.readyState)) {
s.onload = s.onreadystatechange = null; if (h && s.parentNode) { h.removeChild(s) } s = undefined;
if (c) { c() }
}
};
h.insertBefore(s, h.firstChild);
@cmilfont
cmilfont / desafio.md
Last active October 12, 2018 11:45
return true to win

[https://alf.nu/ReturnTrue]

function reflexive(x) {
    return x != x;
}
reflexive(NaN)

function transitive(x,y,z) {
 return x && x == y && y == z && x != z;
@somebox
somebox / osx-setup.sh
Last active December 11, 2021 13:05 — forked from foz/osx-setup.sh.md
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
@shobhitsharma
shobhitsharma / ssl-localhost-webpack.md
Last active August 7, 2023 09:13
SSL support for localhost with Webpack

HTTPS using localhost

To generate a local certiticate and using it, please follow these steps (note: replace MY_DOMAIN, MY_FILENAME and MY_PASSPHRASE based on your choice):

Step 1: Generate private key

openssl genrsa -out MY_FILENAME.key 4096
@pongstr
pongstr / _readme.md
Last active October 26, 2023 05:57
HTTP/2 Recipe: Nginx + Node.js

Imgur

Recipe

Install homebrew/services, this will be helpful, you'll see later. :D

$ brew tap homebrew/services 
@thilinapiy
thilinapiy / mongo-statefulset.yaml
Created October 27, 2017 12:21
MongoDB statefulset for kubernetes with authentication and replication
## Generate a key
# openssl rand -base64 741 > mongodb-keyfile
## Create k8s secrets
# kubectl create secret generic mongo-key --from-file=mongodb-keyfile
---
apiVersion: v1
kind: Service
metadata:
name: mongo
labels:
@ansulev
ansulev / install-arch-linux-on-btrfs-subvolume-inside-luks
Last active December 18, 2023 06:45
Install Arch Linux with full encrypted btrfs subvolume inside luks
# Install Arch Linux with full encrypted btrfs subvolume inside luks
# Hardware: BIOS system, Intel GPU, Nvidia Optimus, Toshiba SSD, Wifi
# Please adjust for your needs.
# filename: install-arch-linux-on-btrfs-subvolume-inside-luks.txt
# The official guide: https://wiki.archlinux.org/index.php/Installation_Guide
# Download the archiso image from https://www.archlinux.org/download/
# Copy to a usb-drive
dd bs=4M if=archlinux.iso of=/dev/sdx status=progress oflag=sync # on linux
@nikhilkumarsingh
nikhilkumarsingh / paint.py
Created November 3, 2017 16:26
A simple paint application using tkinter in Python 3
from tkinter import *
from tkinter.colorchooser import askcolor
class Paint(object):
DEFAULT_PEN_SIZE = 5.0
DEFAULT_COLOR = 'black'
def __init__(self):
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@yorickdowne
yorickdowne / HallOfBlame.md
Last active April 22, 2024 21:38
Great and less great SSDs for Ethereum nodes

Overview

Syncing an Ethereum node is largely reliant on IOPS, I/O Per Second. Budget SSDs will struggle to an extent, and some won't be able to sync at all.

This document aims to snapshot some known good and known bad models.

For size, 4TB or 2TB come recommended as of mid 2024. A 2TB drive should last an Ethereum full node until late 2025 or thereabouts, with crystal ball uncertainty.

High-level, QLC and DRAMless are far slower than "mainstream" SSDs. QLC has lower endurance as well. Any savings will be gone when the drive fails early and needs to be replaced.