Skip to content

Instantly share code, notes, and snippets.

View matedemorphy's full-sized avatar

matedemorphy

View GitHub Profile
import { Component, OnInit } from '@angular/core';
import { Product } from '../shared/models/character';
import { ProductService } from './character.service';
@Component({
selector: 'product-list',
templateUrl: './app/products/product-list.component.html',
providers: [ProductService]
})
# ==============================================================================
#
# SchoolSmart Schedule Import Template for New Milford Public Schools
#
# Questions? Email us at team@getschoolsmart.com
#
# ==============================================================================
# ------------------------------------------------------------------------------
#
function initMap() {
navigator.geolocation.getCurrentPosition(centerMap, locationError);
$scope.correctDir = false;
var options = {
types: [],
componentRestrictions: {country: 'co'}
};
var input = document.getElementById("address-auto");
var autocomplete = new google.maps.places.Autocomplete(input, options);
autocomplete.addListener('place_changed', function() {placeMarker(autocomplete)});
function loadImageErrorOverride(errEvt) {
var pic = errEvt.target;
if (!pic.crossOrigin) return print('Failed to reload ' + pic.src + '!');
print('Attempting to reload it as a tainted image now...');
pic.crossOrigin = null, pic.src = pic.src;
}
function loadImageBypass(URL) {
.stimulus-controller data-controller="obligation"
.modal.fade id="obligation-modal" tabindex="-1" role="dialog" aria-labelledby="obligation-modal"
.modal-dialog role="document"
.modal-content
= simple_form_for([current_owner, @financial_obligation], validate: true, input_html: {class: 'default_class', data: {model: 'financial_obligation'}}) do |f|
.modal-header
h4#obligation-modal-title.modal-title Nueva Obligación
button type="button" class="close" data-dismiss="modal" aria-label="Close"
span aria-hidden="true" ×
.modal-body#modal-financial-obligations-body
<form class="simple_form default_class" id="new_financial_obligation" data-model="financial_obligation" novalidate="novalidate"
data-client-side-validations=
"{&quot;html_settings&quot;:{&quot;type&quot;:&quot;SimpleForm::FormBuilder&quot;,&quot;error_class&quot;:null,&quot;error_tag&quot;:&quot;div&quot;,&quot;wrapper_error_class&quot;:&quot;form-group-invalid&quot;,&quot;wrapper_tag&quot;:&quot;div&quot;,&quot;wrapper_class&quot;:&quot;form-group&quot;,&quot;wrapper&quot;:&quot;vertical_form&quot;},&quot;number_format&quot;:{&quot;separator&quot;:&quot;.&quot;,&quot;delimiter&quot;:&quot;,&quot;},&quot;validators&quot;:{&quot;financial_obligation[holder_id]&quot;:{&quot;presence&quot;:[{&quot;message&quot;:&quot;debe existir&quot;}]},&quot;financial_obligation[financial_entity_id]&quot;:{&quot;presence&quot;:[{&quot;message&quot;:&quot;no puede estar en blanco&quot;}]},&quot;financial_obligation[financial_product_id]&quot;:{&quot;presence&quot;:[{&quot;message&quot;:&quot;no puede estar en blanco&quot;}]}
@matedemorphy
matedemorphy / connection.rb
Created June 7, 2020 05:20 — forked from palkan/connection.rb
Action/AnyCable + Apartment
module ApplicationCable
class Connection < ActionCable::Base::Connection
# we need to keep tenant information for subsequent messages,
# so let's store it as an identifier
identified_by :tenant
def connect
# assuming you store current tenant in session
self.tenant = request.session[:current_tenant]
reject_unauthorized_connection unless tenant
@matedemorphy
matedemorphy / _category.html.slim
Last active June 21, 2020 04:45
stimulus reflex - active storage
#views/categories/_category.html.slim
tr
td = category.name
td
= belonging_products(category.products)
/views/shared/_paginator_nav.html.slim
nav
ul.pagination
li.page-item
a.page-link data-page="#{pagy.prev}" data-reflex="click->TabularReflex#paginate" href="#" ←
- pagy.series.each do |item|
- if item == :gap
li.page-item.disabled
a.page-link ...
- else
<?php
namespace Instagram;
// other classes to use
use Instagram\Request\Request;
use Instagram\Request\Curl;
use Instagram\Request\Params;
use Instagram\Request\Fields;