Skip to content

Instantly share code, notes, and snippets.

View flexchar's full-sized avatar

Luke flexchar

  • Flügger group A/S
  • Copenhagen, DK
  • 16:29 (UTC +02:00)
View GitHub Profile
@flexchar
flexchar / gist:24d824d63c4e3027ea742112e3547dd9
Last active November 15, 2023 11:06 — forked from farico/gist:3938084
Lietuviškų žodžių linksniavimas PHP Trait
<?php
namespace path\to\this;
/**
* Lietuviškų vardų linksniai.
*/
trait Linksniai {
/**
* Vardų transformacija
@flexchar
flexchar / graphics.py
Created November 13, 2017 11:39
Code dump for uni assignment `pip install mysqlclient, matplotlib`
print('\nBooting...\n');
# Import modules
import MySQLdb;
import matplotlib.pyplot as plt;
from math import pi;
def bye():
print("\nDone, shutting down...\n");
exit();
@flexchar
flexchar / notify.js
Last active March 3, 2018 19:01
VueJS Instance to display notifications (toast + snackbar). Depends on Buefy.
/*
* ----------------------------------------------------------------------
* VueJS + Buefy handler for displaying toast and snackbar notifications
* API: https://buefy.github.io/#/documentation/toast
* depends on VueJS and Buefy (and Bulma)
*
* inspired by JACurtis notifiation.blade.php/LaraFlash Package
* https://gist.github.com/jacurtis/9fa687e8f7512bb197decce7ffc30091
* ----------------------------------------------------------------------
*/
@flexchar
flexchar / timetable.vue
Created March 26, 2018 17:15
Timetable.vue - VueJS component foundation for generating timetable slots
<template>
<div>
<h2>Timetable Generator</h2>
<div class="bar">
<input type="text" placeholder="start" v-model="startTime" />
<input type="text" placeholder="end" v-model="endTime" />
<input type="text" placeholder="length" v-model="length" />
<input type="number" placeholder="number" v-model="slots" />
@flexchar
flexchar / index.html
Created May 14, 2018 17:53
Light & Clean Web page for title, font safe
<!DOCTYPE html>
<html>
<head>
<title>{text_here}</title>
<style>
html, body {
height: 100%;
}
body {
margin: 0;
@flexchar
flexchar / resources\lang\en\pagination.php
Created September 24, 2018 10:25
Rich Laravel Bulma Paginator with Localization
<?php
return [
/*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
@flexchar
flexchar / index.html
Created October 17, 2018 04:46
Pretty index.html placeholder
<!DOCTYPE html>
<html>
<head>
<title>PLACEHOLDER</title>
<link href="https://fonts.googleapis.com/css?family=Mali:200" rel="stylesheet" type="text/css">
<style>
html, body {
height: 100%;
#lang plai
(define-type FWAE
[num (n number?)]
[add (lhs FWAE?) (rhs FWAE?)]
[sub (lhs FWAE?) (rhs FWAE?)]
[with (name symbol?) (named-expr FWAE?) (body FWAE?)]
[id (name symbol?)]
[fun (param symbol?) (body FWAE?)]
[app (fun-expr FWAE?) (arg-expr FWAE?)]
@flexchar
flexchar / instagram.ts
Last active June 1, 2019 11:50
Instagram feed component
window.addEventListener(
'DOMContentLoaded',
(): void => {
const container: HTMLDivElement = document.querySelector(
'[data-instagram]'
);
if (!container) {
console.log('No Instagram container found');
return;
@flexchar
flexchar / floatingLabel.ts
Created February 18, 2019 13:29
TypeScript (typed JavaScript) class implementation for toggling floating label classes for form input fields (note that CSS styling is still required)
interface FloatingLabelConstructor {
fieldContainerClass: string;
activeFieldClass: string;
}
class FloatingLabel {
private fields: NodeListOf<HTMLDivElement>;
private className: string;
constructor({ fieldContainerClass, activeFieldClass } = {} as FloatingLabelConstructor) {