This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DISCLAIMER : You can now probably use `data-turbo-action="advance"` on your frame to perform what this controller is aiming to do | |
// https://turbo.hotwired.dev/handbook/frames#promoting-a-frame-navigation-to-a-page-visit | |
// Note that you probably want to disable turbo cache as well for those page to make popstate work properly | |
import { navigator } from '@hotwired/turbo' | |
import { Controller } from '@hotwired/stimulus' | |
import { useMutation } from 'stimulus-use' | |
export default class extends Controller { | |
connect (): void { |
I want to use Rspec to build feature specs that test SR pages, just like normal web pages.
Therefore, I expect Capybara + Rspec to be able to do things like:
visit login_path
fill_in 'Email', with: user.email
fill_in 'Password', with: user.password + 'BAD'
expect(page).to have_content('That email or password is not correct')
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import glob | |
all_bookmarks = [] | |
md_file = open("bookmarks.md", "w+") # saving in markdown file, if no file exists using '+' creates one | |
files = [file for file in glob.glob("JSONBookmarks/*")] # using glob to read all files from the folder | |
for file_name in files: | |
print(file_name) | |
with open(file_name) as bk: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
print "..." | |
time.sleep(1) | |
print "..." | |
print "..." | |
print "..." | |
print "..." | |
time.sleep(1) | |
print "..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a workaround for the rails issue described in | |
# https://github.com/rails/rails/issues/17368. If you use this, | |
# make sure you understand its code and what it does and what it | |
# doesn't. | |
# | |
# See below for an example. | |
# lib/lazy_ids.rb (i.e.) | |
module LazyIds | |
extend ActiveSupport::Concern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get postman app | |
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz | |
sudo tar -xzf postman.tar.gz -C /opt | |
sudo ln -s /opt/Postman/Postman /usr/bin/postman | |
#Create a Desktop Entry | |
cat > ~/.local/share/applications/postman.desktop <<EOL | |
[Desktop Entry] | |
Encoding=UTF-8 |
⚠️ 2019-2020: See more examples and updates on my article here!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository ppa:pinepain/libv8-5.2 | |
sudo apt-get update | |
sudo apt-get install libv8-5.2 | |
sudo pecl install v8js | |
sudo su | |
echo "extension=v8js.so" >> /etc/php/7.1/fpm/php.ini | |
echo "extension=v8js.so" >> /etc/php/7.1/cli/php.ini | |
exit | |
sudo service nginx restart && sudo service php7.1-fpm restart |
NewerOlder