Skip to content

Instantly share code, notes, and snippets.

View ksaver's full-sized avatar

ksaver freakov ksaver

  • localhost
  • 127.0.0.1
View GitHub Profile
@tecnologer
tecnologer / flag_example.go
Created June 16, 2019 20:27
Ejemplo de uso de `flag` para parsear parametros de un string
package main
import (
"flag"
"fmt"
"strings"
)
type flagT string
@ksaver
ksaver / spinner.sh
Last active May 26, 2020 10:11
A spinner in your terminal
#!/bin/bash
# spinner.sh
# A simple spinner in your terminal.
SPINS=(
"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgKiUlJSUlJSUlIyAgICAgICAgICAgICAgICAgICAgKCUlJSUlJSUlJSggICAgICAgICAgICAgICAKICAgICAgICAgICAgKiUlICAgLCgoKiAgICMlIyAgICAgICAgICAgICAgLiUlICAgKCUlJSguICAlJSwgICAgICAgICAgICAKICAgICAgICAgICAlJSAuJSUlJSUlJSUlJS8gLyUsICAgICAgICAgICAlJSAgJSUlJSUlJSUlJSUgICUlICAgICAgICAgICAKICAgICAgICAgICUoICUlJSMgLyUlKCAvJSUlIC4lJS8gICAgICAgIyUlICglJSUgIyUlJSggJSUlKCAlJSAg
@bradtraversy
bradtraversy / myscript.sh
Last active April 22, 2025 23:48
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@compermisos
compermisos / strong-passwords.php
Last active June 8, 2024 20:36 — forked from tylerhall/strong-passwords.php
A user friendly, strong password generator PHP function.
#!/usr/bin/php
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
@prkstaff
prkstaff / init.vim
Last active September 13, 2023 20:27
My NeoVim config + Dracula theme + NerdTree
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
let g:vim_bootstrap_langs = "javascript,php,python,ruby"
# 10_basic.py
# 15_make_soup.py
# 20_search.py
# 25_navigation.py
# 30_edit.py
# 40_encoding.py
# 50_parse_only_part.py
@awesomebytes
awesomebytes / ipython_to_file.md
Created March 16, 2016 10:38
Save iPython session to a python file as code

Save an iPython session commands/code to a file

You must use the magic method %save:

In [1]: %save?
Type:       Magic function
String Form:<bound method CodeMagics.save of <IPython.core.magics.code.CodeMagics object at 0x7fb5d25bb1d0>>
Namespace:  IPython internal
File: /usr/lib/python2.7/dist-packages/IPython/core/magics/code.py
@chluehr
chluehr / date_loop.sh
Created April 26, 2012 20:28
Bash: Loop over dates
#!/bin/bash
now=`date +"%Y-%m-%d" -d "05/06/2012"`
end=`date +"%Y-%m-%d" -d "05/23/2012"`
while [ "$now" != "$end" ] ;
do
now=`date +"%Y-%m-%d" -d "$now + 1 day"`;
echo $now
done
@yevgenko
yevgenko / .Xdefaults
Created August 24, 2011 02:58
URxvt settings with solarized theme
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight