Skip to content

Instantly share code, notes, and snippets.

@rodrigobdz
rodrigobdz / git_blame_sublime_statusbar.py
Created January 20, 2018 16:47
Show Git Blame info for the current line in the Sublime status bar
import sublime
import sublime_plugin
import os
import subprocess
from subprocess import check_output as shell
from datetime import datetime
try:
si = subprocess.STARTUPINFO()
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
@rodrigobdz
rodrigobdz / export_fish_abbreviations.fish
Last active November 3, 2023 20:32
Export fish abbreviations
#!/usr/local/bin/fish
# Use current date as name of file where fish
# abbreviations will be stored
# Format: YYYY-MM-DD
set -lx EXPORT_FILENAME (date "+%Y-%m-%d")
# Prepare destination fish script
echo "#!/usr/local/bin/fish" > $EXPORT_FILENAME.fish
# Write all abbreviations to file
@rodrigobdz
rodrigobdz / replace_line.sh
Last active January 28, 2018 20:45
Replace line in text file
#!/bin/bash
# Copyright (C) 2017 Rodrigo Bermudez Schettino
# Script to replace a line in a text file
# Create file with sample text
echo "this will be replaced" > file.txt
############
# file.txt #
############
@rodrigobdz
rodrigobdz / ping.js
Last active February 13, 2023 14:46
Ping IP Address in React Native
fetch('http://localhost')
.then((response) => {
console.log('response ', response)
if (response.status === 200) {
console.log('success')
} else {
console.warn('error')
}
})
.catch((error) => {
@rodrigobdz
rodrigobdz / parse_function_runner.html
Last active January 28, 2018 20:30
Run single Parse Server function in the browser
<html>
<head>
<script src="http://fb.me/react-0.13.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/parse/1.10.0/parse.js"></script>
</head>
<style type="text/css">
* {
font-family: "Lucida Console", Monaco, monospace;
}
@rodrigobdz
rodrigobdz / javascript.sublime-build
Last active January 27, 2018 15:28
Run a single Parse Server function using node
// Sublime Text - Build System for Javascript
//
// Created using the instructions shown in
// https://gist.github.com/corbanb/d0d6bdcfbd8eb455ce99
{
"cmd": ["/usr/local/bin/node", "$file"],
"selector": "source.js",
}
@rodrigobdz
rodrigobdz / import_bash_aliases.fish
Last active November 3, 2023 01:00 — forked from HiR0GeN/import_bash_aliases.fish
Fish function to import bash aliases to fish abbreviations
# Fish function to import bash aliases v0.2
# Copyright (C) 2016 Malte Biermann
# Copyright (C) 2017 Rodrigo Bermudez Schettino
# Released under the GPL
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#