Skip to content

Instantly share code, notes, and snippets.

View bbg's full-sized avatar
👍
"Our true mentor in life is science."   Mustafa Kemal Atatürk

Batuhan Göksu bbg

👍
"Our true mentor in life is science."   Mustafa Kemal Atatürk
View GitHub Profile
const text = css({
color: '$gray12',
variants: {
size: {
// corrective letter-spacing and text-indent styles
// should go here too, because they're determined by font-size.
// You could also put line-height here too, if your devs prefer
// a default line-height that works in some cases. But understand
// that line-height is also a function of line-length, so the
@bbg
bbg / cacheMiddleware.ts
Created December 16, 2021 09:01 — forked from daniellwdb/cacheMiddleware.ts
Prisma cache middleware
import type { Prisma } from "@prisma/client"
import { redis } from "../redis"
type CacheMiddlewareOptions = {
model: Prisma.ModelName
action: Prisma.PrismaAction
keys?: string[]
defaultValues?: Record<string, unknown>
ttlInSeconds: number
}
@bbg
bbg / GitCommitEmoji.md
Created June 4, 2021 12:05 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@bbg
bbg / error.log
Created May 12, 2021 14:56
umbraco error
{"@t":"2021-05-12T14:51:25.8620403Z","@mt":"An unhandled exception occurred","@l":"Error","@x":"Umbraco.Core.Exceptions.BootFailedException: Boot failed: Umbraco cannot run. See Umbraco's log file for more details.\n\n-> Umbraco.Core.Exceptions.BootFailedException: Boot failed.\n\n-> System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.cmsMacro' with unique index 'IX_cmsMacroPropertyAlias'. The duplicate key value is (renderUmbracoForm).\r\nThe statement has been terminated.\n at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n at System.Data.S
@bbg
bbg / AsJson.cshtml
Created February 15, 2021 08:26 — forked from EdCharbeneau/AsJson.cshtml
Turn any Umbraco content into a JSON object by using a Razor template
@*Experimental, I'm still fairly new to Umbraco there could be an API avialbe for this already.
This was inspired by http://cultiv.nl/blog/razor-vs-base-to-output-json-in-umbraco/
If there is a better way please let me know via twitter @EdCharbeneau
Add this template to your Umbraco site and any content can be called via Ajax using
/mySite/contentPath/?alttemplate=AsJson
Return value will be { propertyAlias : value }
Ex: { "personAlias" : "John Doe", "id" : 1002 }
*@
@bbg
bbg / app.scss
Created January 12, 2021 08:02 — forked from lukaskleinschmidt/app.scss
Utility class generator like tailwindcss but in pure Sass.
@use 'sass:map';
@use 'variants' as * with (
$breakpoints: (
'small': 640px,
'medium': 768px,
'large': 1024px,
'wide': 1280px,
)
);
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
$font-sizes: 6 7 8 9 10 11 12 14 16 18 21 24 36 48 60 72 84 96;
$selector-sizes: ".micro" ".milli" "h6, .zeta" "h5, .epsilon" "h4, .delta" "h3, .gamma" "h2, .beta" "h1, .alpha" ".kilo" ".mega" ".giga";
$base-font-size: 16;
$base-font-size-idx: index($font-sizes, $base-font-size);
$font-class-start-idx: $base-font-size-idx - 3;
@bbg
bbg / install-comodo-ssl-cert-for-nginx.rst
Created September 11, 2020 12:56 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

package main
import (
"database/sql"
"gopkg.in/gorp.v1"
"log"
"strconv"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
{
"data": {
"slider": {
"January1916": [
{
"id": 1,
"domain_ids": "[{\"id\": 2, \"domain_name\": \"Leerfabriek KVL\"}]",
"title": "Oprichting Leerfabriek KVL",
"desc": "In de 15e en 16e eeuw was de leerindustrie heel belangrijk in Brabant. Dat veranderde in de 17e eeuw. Door de tachtigjarige oorlog verdween de industrie bijna helemaal uit onze provincie. De eeuw erna bloeide de industrie weer op: de leerindustrie schoof vanuit Holland op naar Brabant, waar lagere lonen waren en voor het leer betere natuurlijke omstandigheden. Rond 1860 vestigde de meeste looierijen zich in de omgeving van Breda, Tilburg en de ‘Langstraat’ (regio tussen Breda en Waalwijk). ",
"main_photo": "157738370286_oprichting_leerfabriek_kvl.jpg",