This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://gemini.google.com/app/935f6ae050f77ade | |
| It is definitely "extreme" in a world of bulky web apps, but that is the core philosophy of **snips.sh**. It’s built for people who want to stay in the flow of their terminal without switching to a browser, clicking "New," pasting, and hitting "Save." | |
| Since you find the CLI-only creation a bit much, here are the two ways to bridge that gap, plus an alternative that gives you the best of both worlds. | |
| --- | |
| ## 1. The "Web Experience" via SSH |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| // My answer to | |
| // https://stackoverflow.com/questions/61443845/how-to-replicate-this-specific-android-constraint-layout-on-flutter | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| __author__ = 'Kevin Warrick' | |
| __email__ = 'kwarrick@uga.edu, abulka@gmail.com' | |
| __version__ = '2.0.0' | |
| import pickle | |
| from collections import namedtuple | |
| from functools import wraps | |
| import inspect | |
| from icecream import ic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library dedent; | |
| // Translation of Python textwrap.dedent algorithm | |
| // https://github.com/python/cpython/blob/eb97b9211e7c99841d6cae8c63893b3525d5a401/Lib/textwrap.py | |
| import 'package:quiver/iterables.dart'; | |
| String dedent(String text) { | |
| /// Remove any common leading whitespace from every line in `text`. | |
| /// This can be used to make triple-quoted strings line up with the left |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| e.setComponent('Flag', {}) | |
| e.setComponent('Flag2', null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| entity.getComponent('data').completed = false | |
| entity.setComponent('dirty', {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| engine.system('dirty-todoitems', ['data', 'dirty'], (entity, {data, _}) => { | |
| // do something with entity and data | |
| // ... | |
| entity.deleteComponent('dirty') // important! remove dirty flag | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Persistence { | |
| constructor() { | |
| this.todos_data = [] // gather info here | |
| engine.system('reset-save', ['housekeeping'], (entity, { _ }) => { | |
| this.todos_data = [] | |
| }); | |
| engine.system('gather-todos-for-save', ['data'], (entity, { data }) => { | |
| this.todos_data.push(data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let todos_data = [] | |
| engine.system('reset-todo-list', ['housekeeping'], (entity, { housekeeping }) => { | |
| todos_data = [] | |
| }); | |
| engine.system('gather-todos-for-save', ['data'], (entity, { data }) => { | |
| todos_data.push(data) // or push data.title, or push the entity, or whatever you need | |
| }); | |
| engine.system('report-final-result', ['housekeeping'], (entity, { housekeeping }) => { | |
| console.log('final list of todos', todos_data) |
NewerOlder