- We've got some components
A
,B
andC
which provide different slots.const A = { template: `<div><slot name="a">Default A Content</slot></div>` }
const B = {
import wagtail.admin.rich_text.editors.draftail.features as draftail_features | |
from wagtail.admin.rich_text.converters.html_to_contentstate import InlineStyleElementHandler | |
from wagtail.core import hooks | |
@hooks.register('register_rich_text_features') | |
def register_custom_style_feature(features): | |
feature_name = 'mycustomstyle' # .mycustomstyle will have to be defined in the CSS in order to get frontend styles working | |
type_ = feature_name.upper() | |
tag = 'span' |
// Scrollbar with Hover Transition Effect | |
.container::-webkit-scrollbar { | |
width: 14px; | |
} | |
.container::-webkit-scrollbar-thumb { | |
background-clip: content-box; | |
border: 4px solid transparent; | |
border-radius: 7px; | |
box-shadow: inset 0 0 0 10px; | |
} |
UPM: How to make a custom package So, Unity has this shiny new package manager, and you have code you want to share between projects - wouldn't it be great if we could bundle up our shared code and plug it into all the projects that need it? Let's figure out how to make our own Package!
Todo
I've always found the world of python packaging and environment management to be somewhat confusing. Here are some notes that I hope will remind me how it works when I forget.
N.B. I have focused on Pipenv and Pipfile in this article, as they are the latest and greatest way of managing project environments, but the same principles apply to older workflows using virtualenv, pip and requirements.txt.
A Scene Switcher Utility Window for Unity, Switch between Scenes Effortlessly.
Inspired by Kenney sceneWindow.cs
This gist is deprecated due to release of this utility on Asset Store, you can now get the latest version of this utility from Asset Store, but it is available here as is without any updates.
import 'nprogress/nprogress.css' | |
import NProgress from 'nprogress' | |
import axios from 'axios' | |
const calculatePercentage = (loaded, total) => (Math.floor(loaded * 1.0) / total) | |
const setupUpdateProgress = () => { | |
axios.defaults.onDownloadProgress = e => { | |
const percentage = calculatePercentage(e.loaded, e.total) |
#!/bin/bash | |
USER=${1:-sebble} | |
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-) | |
PAGES=$((658/100+1)) | |
echo You have $STARS starred repositories. | |
echo |
from django.core.exceptions import ValidationError | |
from django.forms.utils import ErrorList | |
from wagtail.wagtailcore import blocks | |
class MyLinkBlock(blocks.StructBlock): | |
""" | |
Example validating StructBlock. | |
""" |
#include <SFML/Graphics.hpp> | |
#if _WIN32_WINNT < 0x0501 | |
#define _WIN32_WINNT 0x0501 | |
#endif | |
#include <windows.h> | |
// Set part of the window that can be clicked by removing fully transparent pixels from the region | |
void setShape(HWND hWnd, const sf::Image& image) | |
{ |