Skip to content

Instantly share code, notes, and snippets.

package publisherquerylanguage
import "golang.org/x/exp/errors/fmt"
func (pql *PublisherQueryLanguage) GetAllCountries() (*[]map[string]interface{}, error) {
query := `SELECT Id, CountryCode, CanonicalParentId, Name, Targetable, Type FROM Geo_Target WHERE Targetable='true' AND Type='Country' ORDER BY Name`
return pql.SearchWithStatement(query)
}
func (pql *PublisherQueryLanguage) GetAllStates() (*[]map[string]interface{}, error) {
process.stdin.resume();
process.stdin.setEncoding('utf8');
var util = require('util');
var input = "";
process.stdin.on('data', function (text) {
input += text;
});
@ericraio
ericraio / lru.java
Last active January 14, 2020 20:10
LRU Cache Implementation
package com.learning;
/* package whatever; // don't place package name! */
import java.util.HashMap;
class Entry {
int value;
int key;
Entry left;
Entry right;
# frozen_string_literal: true
class Product::ImportService < ImportService
attr_accessor :product_import
def initialize(object = {})
if object.class == ProductImport
@product_import = object
else
# frozen_string_literal: true
require "rails_helper"
describe ImportService do
with_model :FakeModelImport do
table do |t|
end
model do
# frozen_string_literal: true
class ImportService
class Error < StandardError
end
def initialize
raise ImportService::Error.new("To be implemented by subclass")
end
import React from 'react';
import ReactDOM from 'react-dom'
import { Provider, configureStore } from 'airlytics';
let store;
if (process.env.NODE_ENV === "production") {
store = configureStore({
dripAccountId: "4552197",
});
} else {
import React, { Component } from 'react';
import Block, { Section, Headline, Subheadline, HorizontalForm } from 'components/Elements/Block';
import style from './style.module.scss';
import { connect } from 'airlytics';
align-items: center;
justify-content: center;
text-align: center !important;
class HorizontalFormBlock extends Component {
import React, { Component } from 'react';
import ThemeButton from 'components/Theme/Button';
import style from './style.module.scss';
import Cta from '../Cta';
import { connect } from 'airlytics';
import Validator from 'utils/validator';
class HorizontalForm extends Component {
state = {
import React, { Component } from 'react';
import FormInput from './FormInput';
import Validator from 'utils/validator';
import Button from './Button';
import { FormGroup } from 'styled-bootstrap-components';
import { connect} from 'airlytics';
import { styled } from './Styles';
import titlize from 'utils/titlize';
import PrismicHelper from 'utils/prismicHelper';
import { navigate } from "gatsby-link";