Skip to content

Instantly share code, notes, and snippets.

@kapustis
kapustis / GradientBorder.qml
Created July 13, 2022 12:55 — forked from hweex/GradientBorder.qml
QML gradient border
import QtQuick 2.0
import QtGraphicalEffects 1.0
Rectangle {
id: root
property Gradient borderGradient: borderGradient
property int borderWidth: 1
width: 400
height: 300
radius: 100
@kapustis
kapustis / narcissistic.js
Created February 10, 2022 13:23 — forked from lhuria94/narcissistic.js
A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits.
// For example, take 153 (3 digits):
// 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153
// and 1634 (4 digits):
// 1^4 + 6^4 + 3^4 + 4^4 = 1 + 1296 + 81 + 256 = 1634
// The Challenge:
// Your code must return true or false depending upon whether the given number is a Narcissistic number.
@kapustis
kapustis / button.sass
Created August 30, 2017 12:21 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600
@kapustis
kapustis / favicon-interceptor.js
Created June 30, 2016 12:59 — forked from kentbrew/favicon-interceptor.js
How to short-circuit those annoying favicon requests in node.js
// early experiments with node had mysterious double requests
// turned out these were for the stoopid favicon
// here's how to short-circuit those requests
// and stop seeing 404 errors in your client console
var http = require('http');
http.createServer(function (q, r) {
// control for favicon
#loader {
background: none repeat scroll 0 0 #ffffff;
bottom: 0;
height: 100%;
left: 0;
position: fixed;
right: 0;
top: 0;
width: 100%;
z-index: 9999;
<?php if ( have_posts() ) : query_posts('p=1');
while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php the_post_thumbnail(array(100, 100)); ?>
<? endwhile; endif; wp_reset_query(); ?>