Skip to content

Instantly share code, notes, and snippets.

@baradhiren
baradhiren / .bashrc
Created August 28, 2019 14:38
Termux bashrc with common aliases and functions
#########
# Aliases
#########
# Always copy contents of directories (r)ecursively and explain (v) what was done
alias cp='cp -rv'
# List contents with colors for file types, (A)lmost all hidden files (without . and ..), in (C)olumns, with class indicators (F)
alias ls='ls --color=auto -ACF'
# List contents with colors for file types, (a)ll hidden entries (including . and ..), use (l)ong listing format, with class indicators >
alias ll='ls --color=auto -alF'
@ionurboz
ionurboz / wp-get-taxonomy-hierarchy.php
Created February 23, 2021 12:05 — forked from daggerhart/wp-get-taxonomy-hierarchy.php
WordPress function to get a complete taxonomy hierarchy of terms in PHP
<?php
/**
* Recursively get taxonomy and its children
*
* @param string $taxonomy
* @param int $parent - parent term id
* @return array
*/
function get_taxonomy_hierarchy( $taxonomy, $parent = 0 ) {
@mjbalcueva
mjbalcueva / password-input.tsx
Last active March 19, 2024 09:10
shadcn ui custom password input
"use client"
import { forwardRef, useState } from "react"
import { EyeIcon, EyeOffIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Input, InputProps } from "@/components/ui/input"
import { cn } from "@/lib/utils"
const PasswordInput = forwardRef<HTMLInputElement, InputProps>(
({ className, ...props }, ref) => {
@chrisgillis
chrisgillis / ssl_smtp_example.go
Created April 16, 2014 14:48
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@bertocq
bertocq / atajosEclipse.textile
Last active March 19, 2024 09:06
Atajos de teclado para Eclipse

Atajos de teclado para Eclipse (y derivados como ZendStudio)

Para editar un comando: Window → Preferences → General → Keys

Edición

Ctrl+D elimina la línea actual (en la que se encuentra el cursor)
Ctrl+Shift+F formatear código (tabulaciones, saltos de línea,…)
@dhh
dhh / linux-setup.sh
Last active March 19, 2024 09:05
linux-setup.sh
# CLI
sudo apt update
sudp apt install \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev libsqlite3-0 \
redis-server mysql-server sqlite3 libmysqlclient-dev apache2-utils \
rbenv
@DanWBR
DanWBR / dtl_test.py
Last active March 19, 2024 09:04
Using DWSIM Standalone Thermodynamics Library in Python with Python.NET (Low-Level Flash API + CAPE-OPEN-style calls)
import clr
from System.IO import Directory, Path, File
from System import String, Double, Array, Reflection, Exception
dtlpath = "C:\\Users\\Daniel\\Source\\Repos\\DanWBR\\dwsim6\\DistPackages\\DTL\\"
clr.AddReference(dtlpath + "DWSIM.Thermodynamics.StandaloneLibrary.dll")
from DWSIM.Thermodynamics import Streams, PropertyPackages, CalculatorInterface
@DanWBR
DanWBR / dtl_test2.py
Created November 6, 2020 20:02
Using DWSIM Standalone Thermodynamics Library in Python with Python.NET (High-Level API + Material Stream calls)
import clr, array
from System.IO import Directory, Path, File
from System import String, Double, Array, Reflection, Exception
dtlpath = "C:\\Users\\Daniel\\Source\\Repos\\DanWBR\\dwsim6\\DistPackages\\DTL\\"
clr.AddReference(dtlpath + "DWSIM.Thermodynamics.StandaloneLibrary.dll")
from DWSIM.Thermodynamics import Streams, PropertyPackages, CalculatorInterface