Skip to content

Instantly share code, notes, and snippets.

@cristianossd
cristianossd / redis_cheatsheet.bash
Created May 22, 2023 17:48 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@cristianossd
cristianossd / .bashrc
Created May 15, 2023 13:44
Delete git repository branches locally in a single command (bash, zsh)
# delete branches locally except main
alias git-delete-branches='git branch | egrep -v "(^\*|main)" | xargs git branch -D'
# just run git-delete-branches whenever you want
@cristianossd
cristianossd / insert-encoding.sh
Created June 1, 2020 17:34
Insert utf-8 encoding at beginning of python file
files=$(find . -name '*.py')
for file in $files; do
echo "# -*- coding: utf-8 -*-\n$(<$file)" > $file
done
@cristianossd
cristianossd / drawing-tools.html
Created February 27, 2016 17:18
Using Google Maps drawing tools and getting shape coordinates
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<title>Drawing Tools</title>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false&libraries=drawing"></script>
<style type="text/css">
#map, html, body {