Skip to content

Instantly share code, notes, and snippets.

View lmansur's full-sized avatar

Lucas Mansur lmansur

View GitHub Profile
function! LightlineFiletype()
if &filetype ==? 'ruby'
return ''
elseif &filetype ==? 'javascript'
return ''
endif
return &filetype
endfunction
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
Plug 'thinca/vim-localrc' " Local .vimrc files
Plug 'vim-ruby/vim-ruby'
#!/usr/bin/bash
function _open() {
spotify_uri=$1
is_spotify_running=$(pgrep spotify)
if [[ $is_spotify_running ]]; then
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri string:$spotify_uri
else
spotify --uri=$spotify_uri
module.exports = async function(data) {
if(data.type == 'remote-play') {
// The play button was pressed, we can forward this command to the player using
TrackPlayer.play();
} else if(data.type == 'remote-pause') {
TrackPlayer.pause();
} else if(data.type == 'remote-stop') {
TrackPlayer.stop();
}
};
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, {PureComponent} from 'react';
import {
@lmansur
lmansur / .rb
Created February 8, 2018 00:16
resource = ARGV[0]
directory_pattern = "*#{resource}*/*_spec.rb"
single_spec_pattern = "*/*#{resource}*_spec.rb"
resource_pattern = "**/{#{directory_pattern},#{single_spec_pattern}}"
Dir.chdir("spec")
spec_files = Dir.glob(resource_pattern).sort.uniq.join(" ")
system("rspec #{spec_files}")
@lmansur
lmansur / hz.cfg
Last active April 6, 2017 21:10 — forked from eduardohertz/hz.cfg
CS:GO configuration file
unbindall
bind "CapsLock" "use weapon_smokegrenade"
bind "0" "slot10"
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "4" "slot4"
bind "5" "slot5"
bind "6" "slot6"
bind "7" "slot7"
@lmansur
lmansur / .rb
Created December 1, 2016 00:10
if [endereco.rua, endereco.cidade, endereco.cep].any?(&:blank?)
#do something
end
15:06:46 search.1 | starts elasticsearch
15:06:46 search.1 |
15:06:46 search.1 | Option Description
15:06:46 search.1 | ------ -----------
15:06:46 search.1 | -E <KeyValuePair> Configure a setting
15:06:46 search.1 | -V, --version Prints elasticsearch version information and exits
15:06:46 search.1 | -d, --daemonize Starts Elasticsearch in the background
15:06:46 search.1 | -h, --help show help
15:06:46 search.1 | -p, --pidfile <Path> Creates a pid file in the specified path on start
15:06:46 search.1 | -q, --quiet Turns off standard ouput/error streams logging in console
@lmansur
lmansur / .sh
Created November 23, 2016 17:07
15:06:46 search.1 | starts elasticsearch
15:06:46 search.1 |
15:06:46 search.1 | Option Description
15:06:46 search.1 | ------ -----------
15:06:46 search.1 | -E <KeyValuePair> Configure a setting
15:06:46 search.1 | -V, --version Prints elasticsearch version information and exits
15:06:46 search.1 | -d, --daemonize Starts Elasticsearch in the background
15:06:46 search.1 | -h, --help show help
15:06:46 search.1 | -p, --pidfile <Path> Creates a pid file in the specified path on start
15:06:46 search.1 | -q, --quiet Turns off standard ouput/error streams logging in console