This file contains 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
-- Based on the original articel at http://www.codeproject.com/Articles/22824/A-Model-to-Represent-Directed-Acyclic-Graphs-DAG-o | |
-- Here is a port to MySQL | |
-- Edge table | |
DROP TABLE IF EXISTS `Edge`; | |
CREATE TABLE IF NOT EXISTS `Edge` ( | |
`id` int(11) NOT NULL, | |
`entry_edge_id` int(11) DEFAULT NULL COMMENT 'The ID of the incoming edge to the start vertex that is the creation reason for this implied edge; direct edges contain the same value as the Id column', | |
`direct_edge_id` int(11) DEFAULT NULL COMMENT 'The ID of the direct edge that caused the creation of this implied edge; direct edges contain the same value as the Id column', | |
`exit_edge_id` int(11) DEFAULT NULL COMMENT 'The ID of the outgoing edge from the end vertex that is the creation reason for this implied edge; direct edges contain the same value as the Id column', |
This file contains 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
const crypto = require('crypto'); | |
const algorithm = 'aes-256-ctr'; | |
let key = 'MySuperSecretKey'; | |
key = crypto.createHash('sha256').update(String(key)).digest('base64').substr(0, 32); | |
const encrypt = (buffer) => { | |
// Create an initialization vector | |
const iv = crypto.randomBytes(16); | |
// Create a new cipher using the algorithm, key, and iv | |
const cipher = crypto.createCipheriv(algorithm, key, iv); |
This file contains 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
var crypto = require('crypto'), | |
algo = 'aes-256-cbc', | |
key = 'super123secretKey!'; | |
function encrypt(text){ | |
var cipher = crypto.createCipher(algo,key) | |
var crypted = cipher.update(text,'utf8','hex') | |
crypted += cipher.final('hex'); | |
return crypted; | |
} |
This file contains 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
'use strict'; | |
const crypto = require('crypto'); | |
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key | |
const IV = "5183666c72eec9e4"; // set random initialisation vector | |
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex'); | |
const phrase = "who let the dogs out"; | |
var encrypt = ((val) => { |
This file contains 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/widgets.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
// adapted from https://stackoverflow.com/a/54173729/67655 | |
class ExpandableSection extends HookWidget { | |
const ExpandableSection({ | |
Key key, | |
this.expanded = false, | |
this.child, |
This file contains 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'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Expanding Demo', | |
theme: ThemeData( |
This file contains 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
{ | |
"aliceblue", | |
"antiquewhite", | |
"aqua", | |
"aquamarine", | |
"azure", | |
"beige", | |
"bisque", | |
"black", | |
"blanchedalmond", |
This file contains 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
# Load Gtk | |
import gi | |
gi.require_version('Gtk', '4.0') | |
from gi.repository import Gtk | |
# When the application is launched… | |
def on_activate(app): | |
# … create a new window… | |
win = Gtk.ApplicationWindow(application=app) | |
# … with a button in it… |
This file contains 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
""" | |
Hierarchy is: | |
- GtkMenuBar | |
- GtkMenuItem | |
- GtkMenu | |
- GtkMenuItem | |
- GtkImageMenuItem | |
- GtkCheckMenuItem | |
- GtkRadioMenuItem | |
- GtkSeparatorMenuItem |