Skip to content

Instantly share code, notes, and snippets.

View dvdantunes's full-sized avatar
🦊
sudo kitsune

David Antunes dvdantunes

🦊
sudo kitsune
View GitHub Profile
@dvdantunes
dvdantunes / extramaus.c
Last active August 10, 2024 05:41
ExtraMaus is a tool that shows an additional mouse cursor. Useful for VLC recording. Author: Dodger Tools
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <assert.h>
#include <X11/cursorfont.h>
#include <X11/extensions/shape.h>
// Include the mouse cursor xbm directly
#define mouse_width 12
#define mouse_height 21
@dvdantunes
dvdantunes / hash_string_to_json.rb
Last active August 14, 2019 16:21
hash string to json
# Convert a hash string (a hash that was casted to string using .to_s)
# to a valid json string
#
# @param [String|Hash] hash_string Hash string to parse
# @param [Boolean] prettyfy_for_html [Optional] True if json is wanted to be prettified for HTML output
#
# @return [String]
def hash_string_to_json(hash_string, prettyfy_for_html = true)
# Check if it is already a valid JSON
begin
@dvdantunes
dvdantunes / git-snipets.sh
Last active January 10, 2019 14:14
git-snipets
Git snipets
************
Delete a branch (local or remote)
**************************************
git branch -d the_local_branch
git push origin :the_remote_branch
@dvdantunes
dvdantunes / spree-snipets.sh
Last active January 8, 2020 21:17
Spree snipets
Spree
********
* Create new user
u = Spree::User.new(first_name: 'david', last_name: 'antunes', email: 'dantunes@acid.cl', password: 'spree123', password_confirmation: 'spree123', rut: 241237036)
u.save!
* Spree defase override test
docker-compose run website rake deface:get_result['spree/checkout/_confirm']
@dvdantunes
dvdantunes / postgresql.sh
Last active November 6, 2019 19:27
PostgreSQL
# #postgresql, #bash, #fedora29
# Install
sudo dnf install https://download.postgresql.org/pub/repos/yum/10/fedora/fedora-29-x86_64/pgdg-fedora10-10-4.noarch.rpm
sudo dnf install postgresql10
sudo dnf install postgresql10-server
# pgadmin
# @see https://people.planetpostgresql.org/devrim/index.php?/archives/96-Installing-pgAdmin4-3.X-on-RHEL-CentOS-7-and-Fedora-27.html
sudo dnf install pgadmin4
@dvdantunes
dvdantunes / holis.md
Last active December 14, 2017 15:59
[title] prueba public #holis #chao

holis2

holis3

  • Pick the flowers
  • Call John 9303032332
  • Cancel cable subscription
  • Book the flight tickets