Skip to content

Instantly share code, notes, and snippets.

View diomed's full-sized avatar
:octocat:
hold my catnip!

May Kittens Devour Your Soul diomed

:octocat:
hold my catnip!
View GitHub Profile
@ryanlewis
ryanlewis / sort-teams.js
Created December 15, 2021 16:20
Sort a series of players by a rank into a series of teams
const points = {
'immortal': 7,
'diamond': 6,
'platinum': 5,
'gold': 4,
'silver': 3,
'bronze': 2,
'iron': 1,
};
@michaelroper
michaelroper / tailwind-palettte-app.json
Last active January 19, 2024 23:19
Tailwind CSS default colors in Palettte.app's JSON format
[
{
"paletteName": "gray",
"swatches": [
{
"name": "100",
"color": "#f7fafc"
},
{
"name": "200",
@Awilum
Awilum / navigation.php
Last active December 20, 2018 16:12
Flextype: Navigation based on published pages
// Sort pages by pages slug
<ul class="navbar-nav">
<?php $pages = Content::getPages('', false, 'slug'); ?>
<?php foreach ($pages as $page) { ?>
<?php if ($page['slug'] !== '404' && !(isset($page['visibility']) && ($page['visibility'] === 'draft' || $page['visibility'] === 'hidden'))) { ?>
<li class="nav-item">
<a class="nav-link <?php if (Http::getUriString() == $page['slug']) echo 'active'; ?>" href="<?php echo Http::getBaseUrl().'/'.$page['slug']; ?>"><?php echo $page['title']; ?></a>
</li>
<?php } } ?>
@vctrtvfrrr
vctrtvfrrr / spacing.sass
Last active March 12, 2019 14:49
Sass spacing helper
$sizeUnit: rem
$marginKey: "m"
$paddingKey: "p"
$separator: "-"
$sizes: ("none", 0), ("auto", auto), ("xxs", 0.125), ("xs", 0.25), ("sm", 0.5), ("md", 1), ("lg", 2), ("xl", 4), ("xxl", 8)
$positions: ("t", "top"), ("r", "right"), ("b", "bottom"), ("l", "left")
@function sizeValue($key, $value)
@return if($key == "none" or $key == "auto", $value, $value + $sizeUnit)
@joyheron
joyheron / cookie-jar.hs
Last active March 5, 2018 21:12
Haskell Solution to Cookie Jar
@pixelomo
pixelomo / ScrollToTop.html
Last active March 8, 2017 10:43
Creating a simple scroll to top button. At the bottom of the document you'll see a button with the id of top. Below this I've included a link to jQuery followed by a simple script. First there's a function that is checking what the current window screoll position is, you can see this being logged in the console. When this reaches position 250 it…
<html>
<head>
<style type="text/css">
body{
text-align: center;
font-family: sans-serif;
}
h1{
font-size: 45px;
}
@btfak
btfak / useHexo.md
Created May 26, 2016 09:41
How to use Hexo and deploy to GitHub Pages
@yakunichkin
yakunichkin / JS Up Button
Created June 21, 2015 17:41
Animation UpButton scrolling
<script type="text/javascript">
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function(){
@davidvandenbor
davidvandenbor / grav-cms-twig-loops.twig
Last active November 6, 2019 07:00
GRAV cms TWIG loops
{# find the children (subpages) of a parent page, in this case the "about" page #}
<ul>
{% for p in page.find('/about').children if p != page %}
<li><a href="{{p.url}}">{{ p.title }}</a></li>
{% endfor %}
</ul>
{# show all the pages with a certain category, in this case "cars" #}
<h2>All the CAR posts</h2>
<ul>