Skip to content

Instantly share code, notes, and snippets.

View progapandist's full-sized avatar
👋
Open for Work

Andy Baranov progapandist

👋
Open for Work
View GitHub Profile
import sf from "@util/simple_fetch";
type Indexed = {
[key in string]: unknown;
};
export interface PasswordData extends Indexed {
oldPassword?: string;
newPassword?: string;
}
import mapboxgl from "mapbox-gl"; // ES6 import
import "mapbox-gl/dist/mapbox-gl.css"; // Import module's CSS
import MapboxDirections from "@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions";
import "@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions.css";
const fitMapToMarkers = (map, markers) => {
const bounds = new mapboxgl.LngLatBounds();
markers.forEach((marker) => bounds.extend([marker.lng, marker.lat]));
map.fitBounds(bounds, { padding: 70, maxZoom: 15, duration: 0 });
};
import mapboxgl from "mapbox-gl"; // ES6 import
import "mapbox-gl/dist/mapbox-gl.css"; // Import module's CSS
import MapboxDirections from "@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions";
import "@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions.css";
const fitMapToMarkers = (map, markers) => {
const bounds = new mapboxgl.LngLatBounds();
markers.forEach((marker) => bounds.extend([marker.lng, marker.lat]));
map.fitBounds(bounds, { padding: 70, maxZoom: 15, duration: 0 });
};
import mapboxgl from "mapbox-gl"; // ES6 import
import "mapbox-gl/dist/mapbox-gl.css"; // Import module's CSS
import MapboxDirections from "@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions";
import "@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions.css";
const fitMapToMarkers = (map, markers) => {
const bounds = new mapboxgl.LngLatBounds();
markers.forEach((marker) => bounds.extend([marker.lng, marker.lat]));
map.fitBounds(bounds, { padding: 70, maxZoom: 15, duration: 0 });
};
import mapboxgl from "mapbox-gl"; // ES6 import
import "mapbox-gl/dist/mapbox-gl.css"; // Import module's CSS
import MapboxDirections from "@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions";
import "@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions.css";
const fitMapToMarkers = (map, markers) => {
const bounds = new mapboxgl.LngLatBounds();
markers.forEach((marker) => bounds.extend([marker.lng, marker.lat]));
map.fitBounds(bounds, { padding: 70, maxZoom: 15, duration: 0 });
};
require 'sinatra'
post '/*' do
puts JSON.pretty_generate(request.env)
puts request.body.read
end
put '/*' do
puts JSON.pretty_generate(request.env)
puts request.body.read
class CreateRestaurants < ActiveRecord::Migration[6.1]
def change
create_table :restaurants do |t|
t.string :name
t.integer :rating, null: false, default: 0
t.string :address
t.timestamps
end
end
type NotObject<T> = T extends object ? never : T;
type IndexedFlat<T> = {
[key in string]: NotObject<T>;
};
type IndexedNested = {
[key in string]: object;
};
############################################
### Base image ###
############################################
# Image which will be used for all environments: production, testing & development
ARG RUBY_VERSION=2.7.2
FROM ruby:$RUBY_VERSION-slim-buster as base
ARG PG_MAJOR=12
ARG DEBIAN_FRONTEND=noninteractive
COPY .seatrain/Aptfile /tmp/Aptfile
require 'nokogiri'
require 'open-uri'
require 'pry' # gem install pry (for debugging)
# gem 'httplog'
# - cast:
# - "Tim Robbins"
# - "Morgan Freeman"
# - "Bob Gunton"
# # Only the first 3 first actress/actors