Skip to content

Instantly share code, notes, and snippets.

Christopher Dolinski 1dolinski

Block or report user

Report or block 1dolinski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View head.html
<!-- current style, would like similar style for link -->
<% content_for :description, "#{@post.description}" %>
View gist:2235c0a29ed067a7731917c2698b4c8b
# WORKS: Hits the appropriate blocks
def self.included(clazz) #includes module as a class method
clazz.class_eval do
rescue_from StandardError do |e|
respond(:standard_error, 500, e.to_s)
end
rescue_from ActiveRecord::RecordNotFound do |e|
respond(:record_not_found, 404, e.to_s)
View script.html
<div class="tradingview-widget-container">
<div class="tradingview-widget-container__widget"></div>
<div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/symbols/FX-EURUSD/" rel="noopener" target="_blank"><span class="blue-text">EURUSD Rates</span></a> by TradingView</div>
<script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-single-quote.js" async>
{
"symbol": "FX:EURUSD",
"width": 350,
"colorTheme": "light",
"isTransparent": false,
"locale": "en"
View serializer.rb
class TrendingUserSerializer
include FastJsonapi::ObjectSerializer
set_type :user
attribute :id, :nickname, :karma, :picture
end
class TrendingListsSerializer
include FastJsonapi::ObjectSerializer
set_type :list
belongs_to :user, serializer: Discoveries::TrendingUserSerializer
View hash.rb
{
: data => [{
: id => "88",
: type =>: content,
: attributes => {
: is_sponsored => false,: url => "https://www.youtube.com/watch?v=BmCTQ_mkzHU",: title => "Youtube video title",: created_at => Tue, 18 Jun 2019 16: 59: 26 UTC + 00: 00,: bounty_count => 0,: user_has_bounty => false
},
: relationships => {
: lists => {
: data => [{
View app.js
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import {styled} from 'styletron-react';
const Panel = styled('div', {
backgroundColor: 'lightblue',
fontSize: '12px',
'@media (max-width: 768px)': {
View sc.js
import React from 'react';
import styled from 'styled-components';
import CursorZoom from 'react-cursor-zoom';
const StyledImageZoom = styled(CursorZoom)`
border: 1px solid black;
`
const ImageZoom = () => {
return (
<StyledImageZoom
View sc.js
import React from 'react';
import styled from 'styled-components';
import CursorZoom from 'react-cursor-zoom';
const StyledImageZoom = styled(CursorZoom)`
border: 1px solid black;
`
const ImageZoom = () => {
return (
View denormalize.js
// 1. data modelling and joins?
// allows for querying orders
// requires getting activites and then querying orders
// little slower on the reads?? -- read activity and then read async value details
// can easily read orders?
// a.
// please note that there could be multiple types
x = {
activities: {
View data.js
// Goal1: get activites for user for particular date
// Goal2: get most recent activites in the database for reporting
// Match: UID and startDate
// 2 options
// a. pushed objects
// not sure how to query for both uid AND startDate
// easy to achieve goal 2
z = {
You can’t perform that action at this time.