Skip to content

Instantly share code, notes, and snippets.

View wottpal's full-sized avatar

Dennis Zoma wottpal

View GitHub Profile
@satya164
satya164 / quantity-query.scss
Last active September 7, 2023 20:06
Quantity Queries in Sass
@mixin quantity-query($selector, $type, $amount, $max: null) {
@if $type == at-least {
#{$selector}:nth-last-child(n+#{$amount}),
#{$selector}:nth-last-child(n+#{$amount}) ~ #{$selector} { @content; }
} @else if $type == at-most {
#{$selector}:nth-last-child(-n+#{$amount}):first-child,
#{$selector}:nth-last-child(-n+#{$amount}):first-child ~ #{$selector} { @content; }
} @else if $type == between {
@if type-of($max) != "number" {
@error "Max value must be a number for quantity-query.";
@konrad1977
konrad1977 / enums.swift
Created June 13, 2015 12:06
swift new enums
enum TextCase {
case Uppercase(String)
case Lowercase(String)
}
let values: [TextCase] = [
.Uppercase("FOO"),
.Lowercase("iamlow"),
.Uppercase("BAR"),
]
@fcanas
fcanas / Distance.swift
Created May 21, 2015 15:11
Creating a Numeric Type : Distance
public struct Distance :NumericType {
public var value :Double
public init(_ value: Double) {
self.value = value
}
}
extension Distance :IntegerLiteralConvertible {
public init(integerLiteral: IntegerLiteralType) {
self.init(Double(integerLiteral))
@natecook1000
natecook1000 / CalculatorView.swift
Last active June 6, 2022 01:00
An IBInspectable Calculator Construction Set
// CalculatorView.swift
// as seen in http://nshipster.com/ibinspectable-ibdesignable/
//
// (c) 2015 Nate Cook, licensed under the MIT license
/// The alignment for drawing an String inside a bounding rectangle.
enum NCStringAlignment {
case LeftTop
case CenterTop
case RightTop
@wachilt
wachilt / codepen.php
Last active August 1, 2017 22:37 — forked from plfstr/readme.md
<?php
kirbytext::$tags['codepen'] = array(
'attr' => array(
'height', 'type', 'class'
),
'html' => function($tag) {
$source = $tag->attr('codepen');
@bastianallgeier
bastianallgeier / nginx
Last active November 30, 2023 10:14
nginx setup
# block content
location ~ ^/content/(.*).(txt|md|mdown)$ {
rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect;
}
# block all files in the site folder from being accessed directly
location ~ ^/site/(.*)$ {
rewrite ^/site/(.*)$ /error redirect;
}
@marzapower
marzapower / count_hand.swift
Last active August 29, 2015 14:04
Swift Ninja Final Challenge
enum Suit {
case Clubs, Diamonds, Hearts, Spades
}
enum Rank {
case Jack, Queen, King, Ace
case Num(Int)
}
struct Card {
@ramv
ramv / kirby.conf
Created March 6, 2014 23:49
Kirby NGINX configuration
##############################
## Kirby configuration
##############################
location /kirby/ {
include /etc/nginx/mime.types;
index index.php;
root /var/www/addons88/;
if (!-e $request_filename){
@jacrook
jacrook / font_variables.scss
Last active July 2, 2023 16:47
Sass Css Font Stack Variables
//////////////////////////////////////////////////////////////
// Font Variables (http://cssfontstack.com/)
//////////////////////////////////////////////////////////////
//
// Serif font-stacks
//
$baskerville-font-stack: "Big Caslon", "Book Antiqua", "Palatino Linotype", Georgia, serif !default;
@yitsushi
yitsushi / gist:7961607
Created December 14, 2013 16:44
First image as cover image in Ghost
diff --git a/core/server/models/post.js b/core/server/models/post.js
index b471f51..5e3c680 100644
--- a/core/server/models/post.js
+++ b/core/server/models/post.js
@@ -44,13 +44,19 @@ Post = ghostBookshelf.Model.extend({
saving: function (newPage, attr, options) {
/*jslint unparam:true*/
- var self = this;
+ var self = this,