Skip to content

Instantly share code, notes, and snippets.

@todgru
todgru / elasticsearch-setup-apple-macbook-pro-m1.md
Created February 9, 2023 23:52
Install Elasticsearch 7.x on Apple Macbook Pro M1 Ventura 13.2

Elasticsearch Setup Apple MacBook Pro M1

Apple MacBook Pro M1, 32 GB, Ventura 13.2

Documentation based on comments in this Github Elasticsearch issue.

Install Homebrew

@kotakanbe
kotakanbe / ipcalc.go
Created September 17, 2015 02:59
get all IP address from CIDR in golang
package main
import (
"net"
"os/exec"
"github.com/k0kubun/pp"
)
func Hosts(cidr string) ([]string, error) {
@RonanGil
RonanGil / Conventions_WinForms.txt
Created July 24, 2023 15:48
Naming Conventions - winForms
# Componentes Windows Forms
Common Controls:
----------------
btn Button chk CheckBox ckl CheckedListBox
cmb ComboBox dtp DateTimePicker lbl Label
llb LinkLabel lst ListBox lvw ListView
mtx MaskedTextBox cdr MonthCalendar icn NotifyIcon
nud NumeircUpDown pic PictureBox prg ProgressBar
rdo RadioButton rtx RichTextBox txt TextBox
@JKirchartz
JKirchartz / html5 notepad
Created November 26, 2011 03:28
simple html5 Notepad, saves in localStorage, but you can only have one note at a time.
<!DOCTYPE html>
<html><head><meta charset="UTF-8">
<title>HTML5 notepad app</title>
<meta charset="utf-8">
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<style>
html,body{background:#FCFCFC;color:#444;height:100%;width:100%;margin:0;padding:0;}
#notepad{height:98%;width:98%;padding:1%;font-size:100%;line-height:125%;font-family:san-serif}
::selection{background:#7D7}
::-moz-selection{background:#7D7}
@markopy
markopy / streamlit_command_line.py
Created October 22, 2019 16:23
How to parse command line arguments in streamlit with argparse
# An Example of how to parse command line arguments in streamlit.
# This is free and unencumbered software released into the public domain.
import os
import sys
import random
import argparse
import streamlit as st
parser = argparse.ArgumentParser(description='This app lists animals')
@soof-golan
soof-golan / Dockerfile
Last active April 30, 2024 08:31
Python + Poetry + Docker Example
FROM python:3.10 as python-base
# https://python-poetry.org/docs#ci-recommendations
ENV POETRY_VERSION=1.2.0
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
# Tell Poetry where to place its cache and virtual environment
ENV POETRY_CACHE_DIR=/opt/.cache
@timurbakibayev
timurbakibayev / tetris.py
Last active April 30, 2024 08:29
Tetris game in Python
import pygame
import random
colors = [
(0, 0, 0),
(120, 37, 179),
(100, 179, 179),
(80, 34, 22),
(80, 134, 22),
(180, 34, 22),
@andrewrk
andrewrk / fizzbuzz.zig
Last active April 30, 2024 08:28
fizzbuzz in zig
const std = @import("std");
pub fn main() void {
var i: usize = 1;
while (i <= 100) : (i += 1) {
if (i % 3 == 0 and i % 5 == 0) {
std.debug.warn("FizzBuzz\n");
} else if (i % 3 == 0) {
std.debug.warn("Fizz\n");
} else if (i % 5 == 0) {
@techdecline
techdecline / Add-PsScriptTaskSystem.ps1
Created January 14, 2020 09:20
PowerShell function to register a scheduled task running as SYSTEM
function Add-PsScriptTaskSystem {
param (
[Parameter(Mandatory)]
[String]$TaskName,
[Parameter(Mandatory)]
[String]$ScriptPath
)
$taskName = $TaskName
$trigger = New-ScheduledTaskTrigger -AtLogOn
@ppisarczyk
ppisarczyk / Programming_Languages_Extensions.json
Last active April 30, 2024 08:27 — forked from aymen-mouelhi/languages.json
Programming Languages and their File Extensions
[
{
"name":"ABAP",
"type":"programming",
"extensions":[
".abap"
]
},
{
"name":"AGS Script",