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
// ----
// 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"
@bbg
bbg / gist:d1c4bae8e484acec0a264c50cbd3ea6b
Created April 16, 2020 09:28 — forked from bcremer/gist:12167985b442d0d195de
NGINX as caching REST-API Proxy
upstream backend {
server localhost:8080;
#server backup1.example.com:8080 backup;
#server backup2.example.com:8080 backup;
}
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:10m;
# Set cache key to include identifying components
@bbg
bbg / nginx-stat-failed-13-permission-denied.md
Created April 1, 2020 01:51 — forked from windsting/nginx-stat-failed-13-permission-denied.md
fix: Nginx: stat() failed (13: permission denied)

Nginx: stat() failed (13: permission denied)

from https://stackoverflow.com/questions/25774999/nginx-stat-failed-13-permission-denied

Nginx operates within the directory, so if you can't cd to that directory from the nginx user then it will fail (as does the stat command in your log). Make sure the www-user can cd all the way to the /username/test/static. You can confirm that the stat will fail or succeed by running

sudo -u www-data stat /username/test/static
@bbg
bbg / *constant-locals-loader.md
Created March 13, 2020 20:00 — forked from developit/*constant-locals-loader.md
Inline Webpack CSS Modules classNames, reducing bundle size. https://npm.im/constant-locals-loader

constant-locals-loader for Webpack

This loader optimizes the output of mini-css-extract-plugin and/or css-loader, entirely removing the potentially large CSS classname mappings normally inlined into your bundle when using CSS Modules.

Run npm install constant-locals-loader, then make these changes in your Webpack config:

module.exports = {
 module: {
@bbg
bbg / git-deployment.md
Created March 5, 2020 13:52 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@bbg
bbg / workbench.colorCustomizations.json
Created February 19, 2020 20:18 — forked from jacklorusso/workbench.colorCustomizations.json
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",
@bbg
bbg / grub2_options_update_f.sh
Created February 15, 2020 22:55 — forked from dbfin/grub2_options_update_f.sh
Update grub in Fedora
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
@bbg
bbg / parse_json_post.go
Created February 7, 2020 19:25 — forked from andreagrandi/parse_json_post.go
Parse a JSON http POST in GoLang
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type test_struct struct {
Test string