Skip to content

Instantly share code, notes, and snippets.

View jotafeldmann's full-sized avatar
🐙
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn

Jota Feldmann jotafeldmann

🐙
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
  • São Paulo, SP, Brazil
View GitHub Profile
@jotafeldmann
jotafeldmann / regex_to_find_all_non_ascii_characters.js
Created September 16, 2015 21:43
Regex to find all non-ASCII characters
[^\x00-\x7F]
@jotafeldmann
jotafeldmann / get-exit-signal-for-traps.sh
Last active February 17, 2017 19:53
How to get EXIT SIGNAL in bash for TRAPS
#!/bin/bash
trap_with_arg() {
func="$1" ; shift
for sig ; do
trap "$func $sig" "$sig"
done
}
func_trap() {
@jotafeldmann
jotafeldmann / git-global-ignore.txt
Created April 15, 2017 05:39
Git global ignore
git config --global core.excludesfile ~/.gitignore_global
From: https://help.github.com/articles/ignoring-files/
@jotafeldmann
jotafeldmann / javascript.js
Last active February 27, 2019 18:33
JavaScript: prints the current called function name and arguments from inside the function. VS Code snippet.
{
/*
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, ${id} and ${id:label} and ${1:label} for variables. Variables with the same id are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
@jotafeldmann
jotafeldmann / handlebars-print-keys.html
Last active July 8, 2019 17:29
Print Handlebars Keys
########### REMOVE AFTER USE<br /><br />
{{#each}}
<hr>
Key: {{@key}}<br />
Value: {{.}}<br/>
<hr>
{{/each}}<br /><br />
########### REMOVE AFTER USE<br /><br />
#!/bin/bash
icon=$HOME/.local/share/applications/trash.desktop
trash_script_path=/home/j/workspace/libs/trash-icon-on-dock/trash.sh
while getopts "red" opt; do
case $opt in
r)
if [ "$(gio list trash://)" ]; then
echo -e '[Desktop Entry]\nType=Application\nName=Trash\nComment=Trash\nIcon=user-trash-full\nExec=nautilus trash://\nCategories=Utility;\nActions=trash;\n\n[Desktop Action trash]\nName=Empty Trash\nExec='$trash_script_path -e'\n' > $icon
fi
@jotafeldmann
jotafeldmann / ubuntu_installation_for_mac.md
Last active August 17, 2019 06:14
Ubuntu 18.4 installation for MacAir 2012
# Generated by Gestures 0.2.2 --> https://gitlab.com/cunidev/gestures
# Manual editing might result in data loss!
# Invalid lines
# Unsupported lines
# Swipe threshold (0-100)
@jotafeldmann
jotafeldmann / weekdayEnumSwaggerJson.json
Created March 11, 2020 22:11
Weekday Enum Swagger JSON
"weekDay": {
"type":"string",
"enum": [
"SUNDAY",
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY"
@jotafeldmann
jotafeldmann / monthsEnumSwaggerJson.json
Created March 11, 2020 22:21
Months Enum Swagger JSON
"months": {
"type":"string",
"enum": [
"JANUARY",
"FEBRUARY",
"MARCH",
"APRIL",
"MAY",
"JUNE",
"JULY",