Skip to content

Instantly share code, notes, and snippets.

burningTyger

Block or report user

Report or block burningTyger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@NetOperatorWibby
NetOperatorWibby / access.svelte
Last active Sep 5, 2019
Sapper session handling (creation and updating). Idk if this is the best way of doing things but at least it *works*. Feel free to scrutinize this code and let me know all the ways it sucks.
View access.svelte
<script>
// import
import { onMount } from "svelte";
// util
import { metadata } from "~util";
// redirect
onMount(() => {
// `location.replace` forces a hard refresh in the browser,
@evdama
evdama / ThemeToggle.svelte
Created Aug 4, 2019
switch theme between light and dark
View ThemeToggle.svelte
<script>
import { onMount } from 'svelte';
let html, currentColorScheme = 'light';
onMount(
() => {
html = document.getElementsByTagName('html')[0]
window.matchMedia('(prefers-color-scheme: dark)').addListener(({ matches }) => {
if (matches) {
View Quasar v1.0 Upgrade Notes.md

Quasar 1.0 Upgrade Notes

The Quasar team now have their own upgrade notes as well.

Some simple notes of changes I found during migration from v0.17 to v1.0-beta. I used a fresh app directory created using quasar create <folder> -b dev and copied my components/routes/etc to the new folder.

Renamed Folders

For the most part all folders are the same except for src/plugins. This folder has been renamed to src/boot. They currently function in the same way as before however boot plugins can now by asyncronous.

Router Changes

@eirikb
eirikb / load-vue-components-from-folder.js
Created May 24, 2017
Load all Vue components from a given folder, no need for an "index.js"-file
View load-vue-components-from-folder.js
const req = require.context('./components/', true, /\.(js|vue)$/i);
req.keys().map(key => {
const name = key.match(/\w+/)[0];
return Vue.component(name, req(key))
});
View Gemfile
source "https://rubygems.org"
gem "minitest"
gem "rspec"
View gist:09509566cee1f5bb4115
module CallbackPureRuby
def self.included(klass)
klass.extend ClassMethods
klass.initialize_included_features
end
module ClassMethods
def initialize_included_features
@callbacks = Hash[:before, {}, :after, {}]
@rikukissa
rikukissa / .gitignore
Last active Dec 17, 2015
Darker theme for Shout. Has a bit more eye-friendly color scheme and hides some IMO unnecessary features such as "Leave" and "Submit" buttons.
@nitschmann
nitschmann / easter_day.rb
Last active Mar 15, 2016
Ruby implementation to find out the easter day date for a specific year (based on Anonymous Gregorian algorithm)
View easter_day.rb
require "date"
# anonymous gregorian algorithm (http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm)
def easter_day(year)
if year.is_a?(Integer)
y = year
# calculation
a = y % 19
b = y / 100
c = y % 100
@mattiaslundberg
mattiaslundberg / arch-linux-install
Last active Sep 20, 2019
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
View arch-linux-install
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@XVilka
XVilka / TrueColour.md
Last active Sep 19, 2019
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
You can’t perform that action at this time.