Skip to content

Instantly share code, notes, and snippets.

import 'package:flutter/material.dart';
import 'dart:math' as math;
import 'dart:async';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@toto-castaldi
toto-castaldi / 3d-mesh-scaling-with-tween.html
Last active May 1, 2024 21:15
three.js mesh sphere scaling with Tweens
<body></body>
<script src="http://gamingJS.com/Three.js"></script>
<script src="http://gamingJS.com/ChromeFixes.js"></script>
<script src="http://gamingJS.com/Tween.js"></script>
<script>
var scene = new THREE.Scene();
var width = window.innerWidth - 20;
var height = window.innerHeight - 20;
@Steven24K
Steven24K / ForceDirectedGraph.ts
Created March 26, 2020 14:38
A Force directed graph layouting algorithm based on Fruchterman and Reingold's principle, written in Typescript.
/**
* Force directed graph layout algorithm according to Fruchterman and Reingold's principle.
* The algorithm can be summarized as follows:
* algorithm SPRING(G:graph);
* place vertices of G in random locations;
* repeat N times
* calculate the force on each vertex;
* move the vertex c4
* draw graph on canvas, plotter or any drawing tool.
*
@klich3
klich3 / iphone-addressbar-gap.html
Created January 25, 2022 12:24
Attach some dom element on the bottom of screen as absolute, triggered to move on resize address bar.
<!--
Author: <Anthony Sychev> (hello at dm211 dot com | a.sychev at jfranc dot studio)
Buy me a coffe: https://www.buymeacoffee.com/twooneone
Untitled-1 (c) 2022
Created: 2022-01-25 20:06:02
Desc: Attach some dom element on the bottom of screen as absolute, triggered to move on resize address bar.
-->
<html>
@jonschlinkert
jonschlinkert / markdown-cheatsheet.md
Last active April 11, 2024 04:45
A better markdown cheatsheet.
@rodydavis
rodydavis / flutter_infinite_canvas.dart
Last active April 9, 2024 15:04
Flutter infinite canvas with InteractiveViewer + CustomMultiChildLayout
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math_64.dart' hide Colors;
void main() {
final controller = WidgetCanvasController([
WidgetCanvasChild(
key: UniqueKey(),
offset: Offset.zero,
size: const Size(400, 800),
child: Scaffold(
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@TysonRayJones
TysonRayJones / nvidia_gpu_on_osx.md
Last active April 4, 2024 14:45
How to connect an NVIDIA eGPU to OSX

Using an NVIDIA eGPU with OSX

Installation Instructions

Connecting the eGPU

Do not connect the eGPU to your Macbook until instructed.

@micimize
micimize / tab_navigating_scaffold.dart
Last active April 3, 2024 19:52
Approach for tab-local navigators in flutter. Generalized from https://stackoverflow.com/a/57627826/2234013
import 'package:flutter/material.dart';
class AppScaffold extends StatefulWidget {
final List<WidgetBuilder> pages;
final List<BottomNavigationBarItem> navItems;
const AppScaffold({
Key key,
@required this.pages,
@required this.navItems,
@jampajeen
jampajeen / gist:d19f36a7309d0ead0e1f9735a26d66f3
Created January 12, 2021 15:35
Disable/Enable Mac OSX sleep on lid closed
# disable sleep
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1
# re-enable sleep
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0