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'; | |
/// The ResponsiveLayout widget handles showing the corrct widget based on | |
/// screen sizes. | |
/// | |
/// Similar to UI libraries like TailwindCSS it chooses the layout on width. | |
class ResponsiveLayout extends StatelessWidget { | |
/// The [Widget] shown when the screen size is mobile, this is the default child. | |
final Widget mobile; |
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 skills = [ | |
{ label: 'Perception', value: 'perception' }, | |
{ label: 'Acrobatics', value: 'acrobatics' }, | |
{ label: 'Deception', value: 'deception' }, | |
{ label: 'Intimidation', value: 'intimidation' }, | |
{ label: 'Nature', value: 'nature' }, | |
{ label: 'Performance', value: 'performance' }, | |
{ label: 'Society', value: 'society' }, | |
{ label: 'Survival', value: 'survival' }, | |
{ label: 'Arcana', value: 'arcana' }, |
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
_build/ | |
.elixir_ls/ | |
assets/node_modules/ | |
deps/ | |
priv/static |
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
defmodule PooledConnWeb.Socket.EchoSocket do | |
@moduledoc """ | |
Javascript code to run this (put in .html.eex file): | |
const id = <%= :rand.uniform(10) %>; | |
const websocket = new WebSocket('ws://localhost:4000/socket/websocket?id=' + id); | |
websocket.onopen = (args) => console.info('Open', args); | |
websocket.onmessage = (msg, args) => console.info('Message', msg, args); | |
websocket.onclose = (args) => console.warn('Close', args); | |
""" |
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
#!/bin/bash | |
# Update APT repositories | |
sudo apt-get update | |
# Now, install stuff we need. | |
sudo apt-get install -y vim git curl wget htop postgresql gnupg zsh | |
# Setup Elixir repositories | |
cd /tmp |
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
#!/bin/bash | |
clear | |
set -e | |
# Set keyboard | |
echo "Setting keyboard layout..." | |
loadkeys be-latin1 | |
# Prompting for variables as required | |
echo "Getting required data..." | |
PASSWORD=$(dialog --clear --stdout --backtitle "Arch installer" --no-shadow --title "Enter password for users" --passwordbox "Please enter a strong password for the root user.\n" 8 60 2> /dev/null) |
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
web: | |
image: 'gitlab/gitlab-ce:latest' | |
restart: always | |
hostname: 'localhost' | |
environment: | |
GITLAB_OMNIBUS_CONFIG: | | |
external_url 'http://localhost:9090' | |
gitlab_rails['gitlab_shell_ssh_port'] = 2224 | |
gitlab_rails['backup_path'] = '/var/opt/gitlab/backups' | |
ports: |
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
FROM elixir:alpine | |
WORKDIR /app | |
ARG USER_UID | |
ARG UNAME | |
EXPOSE 4000 | |
RUN apk add --no-cache curl bash | |
RUN curl --url https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh --output /wait-for-it.sh | |
COPY ./docker/entrypoint.sh /entrypoint.sh | |
RUN chmod +x /entrypoint.sh |
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
export default class Cryptor { | |
constructor() { | |
this.AES_ALGO = 'AES-CBC'; | |
this.DERIVE_ALGO = 'PBKDF2'; | |
this.HASH_ALGO = 'SHA-256'; | |
this.KEY_BITS = 256; | |
this.KEY_ITERATIONS = 1000; | |
} | |
encrypt(data, password) { |
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
startsudo() | |
{ | |
sudo -v | |
( while true; do sudo -v; sleep 50; done; ) & | |
SUDO_PID="$!" | |
trap stopsudo SIGINT SIGTERM | |
} | |
stopsudo() | |
{ | |
kill "$SUDO_PID" |
NewerOlder