Skip to content

Instantly share code, notes, and snippets.

@stansidel
stansidel / main.dart
Created Sep 6, 2021
Flutter Cupertino Basic Navigation
View main.dart
import 'package:flutter/cupertino.dart';
void main() {
runApp(CupertinoApp(
home: MyAppHome(), // becomes the route named '/'
routes: <String, WidgetBuilder>{
'/a': (BuildContext context) => const MyPage(title: 'page A'),
'/b': (BuildContext context) => const MyPage(title: 'page B'),
'/c': (BuildContext context) => const MyPage(title: 'page C'),
},
View gist:6c930286b67c58b0d1bd8240ca8cab50
GET /subscription/fail HTTP/1.1
Host: aa062f5____.ngrok.io
Upgrade-Insecure-Requests: 1
DNT: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36 Edg/89.0.774.68
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: navigate
Sec-Fetch-Dest: document
Referer: https://securepay.tinkoff.ru/
View controllers.application\.js
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
View components.simple-drag\.js
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
export default class SimpleDrag extends Component {
@tracked statusText = "";
@tracked overDropZone = false;
@action dragHasStarted() {
@stansidel
stansidel / index.html
Last active Oct 9, 2020
Independently scrollable 3-paner with a header for 2 panes
View index.html
<!DOCTYPE html>
<html>
<head>
<style>
.container {
width: 100%;
height: 100vh;
display: flex;
flex-wrap: wrap;
View assign_in_container.cpp
#include <iostream>
#include <string>
#include <utility>
#include <future>
#include <mutex>
#include <random>
#include <thread>
#include <chrono>
#include <sstream>
View properties.swift
import Foundation
class MyClass {
private let name: String
init(name: String) {
self.name = name
}
// Pure computed property, cannot be set. Behaves like a constant field for the user of the class
var computed: String {
@stansidel
stansidel / class-vs-struct.swift
Created Jun 19, 2019
Мутабельность классов и структур
View class-vs-struct.swift
class MyClass {
var name: String
init(name: String) {
self.name = name
}
}
var mc1 = MyClass(name: "Name 1")
View gist:0ac64647d3a55338e65de0839c40132a
<script>
$(document).on('click', '#make_header_red', function() {
$('#header').css('font-color', 'red');
});
</script>
View gist:6c0216a3744ebab63041595a96917846
Module::IncludeModule('iblock');
$Res = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 1, "ACTIVE" => 'Y'), false, false, array());
while ($arItem = $res->GetNext()) {
echo $arItem["NAME"]."\n";
}