Skip to content

Instantly share code, notes, and snippets.

@zombiemachines
zombiemachines / main.dart
Created March 30, 2020 10:19 — forked from graphicbeacon/main.dart
"Learn Dart Before you Flutter" Youtube video solution
class Order {
var _id;
var _reference;
var date;
var code;
List<String> bookings;
Order(this._id, this._reference, {this.date});
Order.withDiscount(this._id, this._reference, [this.code]) {
date = DateTime.now();
@zombiemachines
zombiemachines / hacker_news_scraper_test.dart
Created February 27, 2020 20:17 — forked from graphicbeacon/hacker_news_scraper_test.dart
Code snipper for "Write your first Web Scraper in Dart" Medium post
void main() {
MockClient client = null;
test('calling initiate(client) returns a list of storylinks', () async {
// Arrange
client = MockClient((req) => Future(() => Response('''
<body>
<table><tbody><tr>
<td class="title">
<a class="storylink" href="https://dartlang.org">Get started with Dart</a>
@zombiemachines
zombiemachines / main.dart
Created February 27, 2020 16:56 — forked from StrykerKKD/main.dart
Web scraping with Dart 2
import 'dart:async';
import 'package:http/http.dart' as http;
import 'package:html/parser.dart' as parser;
import 'package:html/dom.dart';
main() async {
http.Response response = await http.get('https://news.ycombinator.com/');
Document document = parser.parse(response.body);
class _DiamondBorder extends ShapeBorder {
const _DiamondBorder();
@override
EdgeInsetsGeometry get dimensions {
return const EdgeInsets.only();
}
@override
Path getInnerPath(Rect rect, { TextDirection textDirection }) {
class ScreenOne extends StatefulWidget {
@override
_ScreenOneState createState() => _ScreenOneState();
}
class _ScreenOneState extends State<ScreenOne> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
@zombiemachines
zombiemachines / MeshDestroy.cs
Created August 20, 2019 16:36 — forked from ditzel/MeshDestroy.cs
MeshDestroy => Put it on a game object with a mesh filter and renderer. Make sure to have read/write enabled on fbx import
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeshDestroy : MonoBehaviour
{
private bool edgeSet = false;
private Vector3 edgeVertex = Vector3.zero;
private Vector2 edgeUV = Vector2.zero;
using UnityEngine;
using UnityEngine.EventSystems;
public class FixedButton : MonoBehaviour, IPointerUpHandler, IPointerDownHandler
{
[HideInInspector]
public bool Pressed;
// Use this for initialization
void Start()
Shader "Custom/HlslFog"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" { }
_FogColor ("Fog Color (RGB)", Color) = (0.5, 0.5, 0.5, 1.0)
_FogStart ("Fog Start", Float) = 0.0
_FogEnd ("Fog End", Float) = 10.0
}
SubShader
Shader "Custom/AlphaMask_Additive"
{
Properties
{
_TintColor ("Tint Color", Color) = (0.5, 0.5, 0.5, 0.5)
_MainTex ("Base (RGB)", 2D) = "white" { }
_AlphaMask ("Alpha Mask", 2D) = "white" { }
_AlphaAmount ("Alpha Amount", Range(-1, 1)) = 1
}
Shader "Custom/AlphaMask_Unlit"
{
Properties
{
_TintColor ("Tint Color", Color) = (0.5, 0.5, 0.5, 0.5)
_MainTex ("Base (RGB)", 2D) = "white" { }
_AlphaMask ("Alpha Mask", 2D) = "white" { }
_AlphaAmount ("Alpha Amount", Range(-1, 1)) = 1
}
SubShader