Contents:
- show full path for the item
- show tree in ol li
- show tree in dropdown select
- one item
Note: this assumes you are using ZSH shell. | |
## Installation | |
Install [asdf](https://github.com/asdf-vm/asdf): | |
``` | |
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0 | |
$ echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc | |
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc |
ERROR | |
======= | |
$ gem install pg -v '0.17.0' | |
Building native extensions. This could take a while... | |
ERROR: Error installing pg: | |
ERROR: Failed to build gem native extension. | |
/home/vishal/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb | |
checking for pg_config... yes |
import { Controller } from "stimulus"; | |
export default class extends Controller { | |
initialize() { | |
this.registerAliasedControllers() | |
} | |
registerAliasedControllers() { | |
for (let [alias, original] of this.controllerIdentifiersByAlias) { | |
if (!this.moduleForIdentifier(alias)) { |
sudo -u postgres psql -c 'SHOW config_file' | |
sudo nano /etc/postgresql/13/main/postgresql.conf | |
# uncomment line 59: | |
#------------------------------------------------------------------------------ | |
# CONNECTIONS AND AUTHENTICATION | |
#------------------------------------------------------------------------------ | |
# - Connection Settings - |
import { Controller } from "stimulus" | |
import { DirectUpload } from "@rails/activestorage" | |
import Dropzone from "dropzone" | |
import { getMetaValue, findElement, removeElement, insertAfter } from "helpers" | |
Dropzone.autoDiscover = false | |
export default class extends Controller { | |
static targets = [ "input" ] |
/** | |
* Toggle fullscreen function who work with webkit and firefox. | |
* @function toggleFullscreen | |
* @param {Object} event | |
*/ | |
function toggleFullscreen(event) { | |
var element = document.body; | |
if (event instanceof HTMLElement) { | |
element = event; |
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
# Get YouTube ID from various YouTube URL | |
# Ruby port from JavaScript version: https://gist.github.com/takien/4077195/ | |
def get_youtube_id(url) | |
id = '' | |
url = url.gsub(/(>|<)/i,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/) | |
if url[2] != nil | |
id = url[2].split(/[^0-9a-z_\-]/i) | |
id = id[0]; | |
else |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg | |
Exemplu: | |
http://img.youtube.com/vi/82W503BSF10/0.jpg | |
And for Vimeo, we can get like this: | |
http://vimeo.com/api/v2/video/<video-id>.json |