Skip to content

Instantly share code, notes, and snippets.

@loderunner
loderunner / osx-ld.md
Last active May 5, 2024 12:02
potential blog posts

ld – Wading through Mac OS X linker hell

Intro

Friend: I tried looking at static linking in Mac OS X and it seems nearly impossible. Take a look at this http://stackoverflow.com/a/3801032

Me: I have no idea what that -static flag does, but I'm pretty sure that's not how you link to a library. Let me RTFM a bit.

Minutes later...

@irazasyed
irazasyed / block-robots.php
Created February 12, 2015 13:14
PHP: Block Robots using Headers in PHP.
<?php
@header('X-Robots-Tag: "none, noindex, nofollow, noarchive, nosnippet, noodp, notranslate, noimageindex"');
@terickson001
terickson001 / main.odin
Last active May 5, 2024 12:01
vulkan-tutorial example in Odin
import "shared:shaderc"
import "vendor:glfw"
import vk "vendor:vulkan"
MAX_FRAMES_IN_FLIGHT :: 2
Context :: struct
{
instance: vk.Instance,
@andyj
andyj / html_for_international_calling coes.htm
Created October 22, 2013 21:57
HTML <select> international calling codes for each country
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
@wojteklu
wojteklu / clean_code.md
Last active May 5, 2024 11:52
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

//
// DateTimeTimerView..swift
import SwiftUI
struct DateTimeTimerView: View {
var body: some View {
NavigationStack {
List {
// 1. Month, day, year
@fnky
fnky / ANSI.md
Last active May 5, 2024 11:49
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@gagregrog
gagregrog / bash_menu.sh
Created August 23, 2021 03:29
Ephemeral Interactive Bash Menu with Up/Down selection or numeral selection
# Original solution sourced from:
# https://unix.stackexchange.com/questions/146570/arrow-key-enter-menu
#
# Updated to do the following:
# - Display index with each option
# - Choose options 1-9 with numeric input
# - Clear the menu and reset the cursor when an option is selected
#
# Arguments:
# array of options
@stephenmm
stephenmm / file_menu2.bash
Created July 12, 2018 20:23
Interactive and visual selection of array with arrows or 'j' 'k' keys. Can also edit (with autocomplete) the selection
#!/usr/bin/env bash
# Started from this code: https://unix.stackexchange.com/a/415155/14014
# Renders a text based list of options that can be selected by the
# user using up, down, 'j', 'k', and enter keys and returns the
# string in provided file.
# 'e' to edit the current string
# 'q' to quit
#
# Arguments : list of options, maximum of 256
@davidfowl
davidfowl / dotnetlayout.md
Last active May 5, 2024 11:47
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/