Skip to content

Instantly share code, notes, and snippets.

View sebackend's full-sized avatar
🏠
Working from home

Sebastián Estrada sebackend

🏠
Working from home
  • Santiago, Chile
View GitHub Profile
{
"workbench.colorTheme": "Oceanic Plus",
"workbench.iconTheme": "file-icons",
"security.workspace.trust.untrustedFiles": "open",
"editor.fontFamily": "'Operator Mono Lig', Consolas, 'Courier New', monospace", //"Fira Code",
"editor.fontLigatures": true,
"editor.fontWeight": "100",
"editor.fontSize": 14,
"editor.tabSize": 2,
"explorer.confirmDelete": false,

1.- Crear nuevo usuario

Para evitar entrar como usuario root, crear otro usuario y darle permisos de sudo

$ sudo adduser deploy

2.- Otorgar permisos de sudo

function previewImage(input, previewSelector) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
$(previewSelector).attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
@sebackend
sebackend / setup_react_native.md
Last active February 7, 2019 18:12
React Native setup - with expo

1.- Instalación

- Con Expo

$ sudo npm install -g create-react-native-app
$ sudo npm install --global expo-cli
- Usando el cli
$ npm install -g react-native-cli
@sebackend
sebackend / setup_rspec.md
Last active January 16, 2020 14:56
Setup Rspec in Rails 5

1.- Setting up rspec

group :development, :test do
  gem 'rspec-rails', '~> 3.6.0'
end

1.- Instalar

@sebackend
sebackend / git-pre-push-install.sh
Last active May 16, 2018 15:26
git pre-push hook for rspec
cd /path/to/your/repo
curl https://gist.githubusercontent.com/smezae/743378e474a87c450b061045ee250a50/raw/71ee093163ea8f7c73f1a7217f6416ac7092d3ba/pre-push.sh > .git/hooks/pre-push
chmod u+x .git/hooks/pre-push
[
{ "keys": ["ctrl+shift+o"], "command": "prompt_open_folder" },
{ "keys": ["ctrl+shift+m"], "command": "toggle_menu"},
{ "keys": ["ctrl+shift+s"], "command": "auto_save" },
// Multiple carets
{ "keys": ["ctrl+alt+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["ctrl+alt+down"], "command": "select_lines", "args": {"forward": true} },
{ "keys": ["ctrl+keypad_divide"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+keypad_divide"], "command": "toggle_comment", "args": { "block": true } },
//{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} }
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/gruvbox/gruvbox (Dark) (Hard) NDC.sublime-color-scheme",
"font_face": "Courier New",
"font_options":
[
"bold"
],
"font_size": 14,
@sebackend
sebackend / Table-Filter-by-Column-VanillaJS.html
Last active May 4, 2017 15:49
Filtrar elementos de una tabla al ingresar texto en un input, según cierta columna
<!-- CSS -->
<style>
/* enable absolute positioning */
.inner-addon {
position: relative;
}
/* style glyph */
.inner-addon .glyphicon {
position: absolute;