FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| require "openssl" | |
| require "digest" | |
| def aes128_cbc_encrypt(key, data, iv) | |
| key = Digest::MD5.digest(key) if(key.kind_of?(String) && 16 != key.bytesize) | |
| iv = Digest::MD5.digest(iv) if(iv.kind_of?(String) && 16 != iv.bytesize) | |
| aes = OpenSSL::Cipher.new('AES-128-CBC') | |
| aes.encrypt | |
| aes.key = key | |
| aes.iv = iv |
| { | |
| "info": { | |
| "_postman_id": "32c262fa-7384-4477-a610-cde252c8829e", | |
| "name": "Tinxy Open APIs", | |
| "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
| }, | |
| "item": [ | |
| { | |
| "name": "Device State", | |
| "request": { |
| #!/bin/bash | |
| rev="12" | |
| _log(){ | |
| echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log | |
| } | |
| _log_para(){ | |
| echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - = &/" >> /tmp/ffmpeg.log |
| 0-mail.com | |
| 007addict.com | |
| 020.co.uk | |
| 027168.com | |
| 0815.ru | |
| 0815.su | |
| 0clickemail.com | |
| 0sg.net | |
| 0wnd.net | |
| 0wnd.org |
| Accessing Helper modules in rails | |
| http://www.funonrails.com/2010/12/accessing-helper-modules-in-rails.html | |
| 1. Helper methods all the time for views | |
| class ApplicationController < ActionController::Base | |
| helper :all# include all helpers, all the time for views | |
| end |
| module JsonSerializer | |
| module_function | |
| # | |
| # Usage: | |
| # JsonSerializer.find_by_id(User, 1, only: [:id, email, :address], except: [:address]) | |
| # | |
| def find_by_id(klass, id, options = {}) | |
| sql = "SELECT row_to_json(results) FROM ( | |
| SELECT #{selected_attributes(klass, options)} |
| <template> | |
| <Span v-bind:class="classes + ' ' + type" v-bind:text="getIcon()" /> | |
| </template> | |
| <script> | |
| /* | |
| Setup: | |
| 1. Setup CSS and Font in Native Script App like this: | |
| https://medium.com/@JCAguilera/fontawesome-5-and-nativescript-22653f2b3bac | |
| Thanks > Juanky Aguilera |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| upstream myapp_puma { | |
| server unix:/tmp/myapp_puma.sock fail_timeout=0; | |
| } | |
| # for redirecting to https version of the site | |
| server { | |
| listen 80; | |
| rewrite ^(.*) https://$host$1 permanent; | |
| } | |