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 'dart:math' as math; | |
| import 'package:flutter/gestures.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/rendering.dart'; | |
| const double _kRadiansPerDegree = math.pi / 180; | |
| class Star extends StatelessWidget { | |
| final Color color; |
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 RectsExample extends StatefulWidget { | |
| @override | |
| _RectsExampleState createState() => _RectsExampleState(); | |
| } | |
| class _RectsExampleState extends State<RectsExample> { | |
| int _index = -1; | |
| @override | |
| Widget build(BuildContext context) { |
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
| ! *----------------------------* | |
| ! | Dotfiles - .Xresources | | |
| ! *----------------------------* | |
| ! This files contains configuration for: | |
| ! * terminal colours | |
| ! * urxvt | |
| ! * rofi |
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
| { config, pkgs, ... }: | |
| { | |
| imports = | |
| [ # Include the results of the hardware scan. | |
| ./hardware-configuration.nix | |
| ]; | |
| boot.loader.systemd-boot.enable = true; | |
| boot.loader.efi.canTouchEfiVariables = true; |
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
| """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| " Font | |
| :set guifont=Source\ Code\ Pro:h14 | |
| """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| " Hide pointless junk at the bottom, doesn't work in .vimrc for some reason? | |
| :set laststatus=0 | |
| :set noshowmode "don't show --INSERT-- | |
| :set noruler "don't show line numbers/column/% junk |
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
| # Add this to your i3 config (~/.config/i3/config) and restart i3 (Super+Shift+R) | |
| exec --no-startup-id "terminator -m" | |
| for_window [class="Terminator" title="^((?!Terminator Preferences).)*$"] move scratchpad, move position 0 0, resize set 1366 768; | |
| bindsym F1 [class="Terminator"] scratchpad show; |
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
| var spawn = require('child_process').spawn; | |
| var pass = require('stream').PassThrough; | |
| var a = spawn('echo', ['hi user']); | |
| var b = new pass; | |
| var c = new pass; | |
| a.stdout.pipe(b); | |
| a.stdout.pipe(c); |
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
| package main | |
| // using asymmetric crypto/RSA keys | |
| import ( | |
| "crypto/rsa" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" |
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
| function autobind<TFunction extends Function>(constructor: TFunction):TFunction { | |
| const newConstructor = function(...args) { | |
| constructor.apply(this, args); | |
| for (const property in this) { | |
| if (typeof this[property] !== typeof Function) { | |
| continue; | |
| } | |
| this[property] = this[property].bind(this); | |
| } |
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
| export type Constructor<T = {}> = new(...args: any[]) => T; | |
| export interface FirstMixin { firstMethod: () => void; } | |
| export interface SecondMixin { secondMethod: () => void; } | |
| export interface UsingFirstMixin { useFirstMethod: () => void; } | |
| export interface UsingFirstAndSecondMixin { useFirstAndSecondMethod: () => void; } | |
| export function FirstMixin <T extends Constructor<{}>>(Base: T) { | |
| return class First extends Base implements FirstMixin { | |
| firstMethod() { |