Skip to content

Instantly share code, notes, and snippets.

@varyen
varyen / vue-noindex.js
Last active March 27, 2019 19:14
Vue component: prevent childs from indexing by crawlers
export default {
name: 'NoIndex',
functional: true,
props: {
tag: {
type: String,
default: 'div',
},
@superseb
superseb / nginx.conf
Last active January 5, 2019 21:41
Example nginx.conf for SSL termination for Rancher
upstream rancher {
server rancher-server:80;
}
map $http_upgrade $connection_upgrade {
default Upgrade;
'' close;
}
server {
@jlblancoc
jlblancoc / Install_gcc7_ubuntu_16.04.md
Last active May 7, 2024 14:57
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

@ajdruff
ajdruff / fix-git-line-endings
Last active February 29, 2024 13:02
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@dohomi
dohomi / FileContainer.vue
Last active January 13, 2019 09:23
File container for vuetify and graph.cool. It lists files provided by a prop with link to the public url. Below it shows a file upload field
<template>
<div>
<h3 class="subheading" v-if="!hideLabel">{{label}}</h3>
<v-list v-if="mediaList">
<v-list-tile v-for="(item,i) in mediaList" :key="i">
<v-list-tile-avatar @click="onItemClick(item.url)">
<img :src="item.url" :alt="item.name" :title="item.name"/>
</v-list-tile-avatar>
<v-list-tile-content @click="onItemClick(item.url)">
<v-list-tile-title>{{item.contentType}}</v-list-tile-title>
@zmts
zmts / info.md
Last active February 2, 2018 20:08
Vue.js Global SASS/SCSS variables

Используем SASS переменные в Vue.js (webpack template)

Есть несколько вариантов решить эту проблему

  • импортить файл с переменными в каждый компонент
  • использовать лоадер для Вебпака sass-resources-loader что бы переменные были доступны глабально

Ставим sass-resources-loader npm install sass-resources-loader --save-dev

Правим build/utils.js

@azimidev
azimidev / .htaccess
Last active August 19, 2023 05:53
The Best .htaccess with browser caching and gzip
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
@ajdavis
ajdavis / dnssd.cpp
Created July 28, 2017 18:59 — forked from scaryghost/dnssd.cpp
How to do a SRV or TXT record lookup in C/C++ on Linux.
/**
* compile: g++ -std=c++0x -o dnssd dnssd.cpp -lresolv
* Your g++ compiler must have lambda support
*
* Code based on examples from:
* http://www.cs.columbia.edu/~zwb/project/dotslash/dots_apache/dnsc.c
* http://people.samba.org/bzr/jerry/slag/unix/query-srv.c
*/
#include <arpa/nameser.h>
#include <functional>
@katursis
katursis / Dockerfile
Last active June 11, 2023 06:45
Dockerfile for SA:MP server-side development
FROM debian:buster
# set variables
ENV SAMP_SERVER_LINUX_URL http://files.sa-mp.com/samp037svr_R2-2-1.tar.gz
ENV SAMP_SERVER_WIN32_URL http://files.sa-mp.com/samp037_svr_R2-2-1_win32.zip
ENV PAWN_COMPILER_VERSION 3.10.10
ENV BOOST_VERSION 1.67.0
# install packages
RUN apt-get update && apt-get install -y \
gcc \
g++-multilib \
@brahimmachkouri
brahimmachkouri / uninstall_ajenti.sh
Last active August 2, 2022 19:34
Uninstall Ajenti
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
DISTRO=
OS=
if grep 'Debian' /etc/issue > /dev/null 2>&1 ; then