Skip to content

Instantly share code, notes, and snippets.

@Asjas
Asjas / reset.css
Created May 19, 2021 07:09
Modern CSS Reset - Andy Bell
// https://piccalil.li/blog/a-modern-css-reset
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
@leanazulyoro
leanazulyoro / server.js
Last active April 11, 2025 05:11
Next.js SSR Cache using LRU Cache
const express = require('express')
const next = require('next')
const Cache = require('lru-cache');
const compression = require('compression')
const port = parseInt(process.env.PORT, 10) || 3000
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
<script>
// vuejs with crypto-js - AES256 encrypt | decrypt api login
import CryptoJS from 'crypto-js'
import axios from 'axios'
import format from 'date-fns/format'
const key = '82f2ceed4c503896c8a291e560bd4325' // change to your key
const iv = 'sinasinasisinaaa' // change to your iv
const apiKey = '123xxxyyyzzz' // change to your api key
const username = 'chhumsina'
@himanshk96
himanshk96 / SQLZOO Window Function Solutions
Created April 6, 2020 11:27
SQLZOO Window Function Solutions
1.
Show the lastName, party and votes for the constituency 'S14000024' in 2017.
SELECT lastName, party, votes
FROM ge
WHERE constituency = 'S14000024' AND yr = 2017
order by votes desc
Who won?
@Prezens
Prezens / gist:f99fd28124b5557eb16816229391afee
Created April 2, 2019 07:40
Apache .htaccess settings for Vue, vue-router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations
@tedigc
tedigc / Edg32.java
Created October 20, 2018 22:56
All of the colours from @ENDESGA's edg32 palette, in order of hue
package com.halfcut.galaxygarden.util;
import com.badlogic.gdx.graphics.Color;
/**
* @author halfcutdev
* @since 09/09/2017
*
* All of the colours from @ENDESGA's edg32 palette, in order of hue
*
extends Node
var client
var wrapped_client
var connected = false
var message_center
var should_connect = false
func _ready():

If .DS_Store was never added to your git repository, simply add it to your .gitignore file.

If you don't have one, create a file called

.gitignore

In your the root directory of your app and simply write

@Mo45
Mo45 / discord.msg.send.php
Last active September 2, 2024 14:57
PHP - Send message to Discord via Webhook
<?php
//=======================================================================================================
// Create new webhook in your Discord channel settings and copy&paste URL
//=======================================================================================================
$webhookurl = "YOUR_WEBHOOK_URL";
//=======================================================================================================
// Compose message. You can use Markdown
// Message Formatting -- https://discordapp.com/developers/docs/reference#message-formatting
@tylermilner
tylermilner / Slow_Compiling_Swift_Code.swift
Created November 27, 2017 22:55
Code samples of common sources of slowdowns for the Swift 2/3 compiler.
//
// The code snippets below showcase common "problem code" that can take a long time to compile.
// These examples were primarily observed in Swift 2/3 and may no longer be relevant in Swift 4 or higher.
//
/// 1. Array concatenation
// Observed by Robert Gummesson - https://medium.com/@RobertGummesson/regarding-swift-build-time-optimizations-fc92cdd91e31#c75c
// Joining two arrays together with the '+' operator can be expensive to compile.
let someArray = ["a", "b"] + ["c", "d"]