Skip to content

Instantly share code, notes, and snippets.

View MakStashkevich's full-sized avatar
🍀
believe on the best

Maksim Stashkevich MakStashkevich

🍀
believe on the best
View GitHub Profile
@glebcha
glebcha / gulpfile.js
Last active September 14, 2022 08:39
Gulp task sample (css and js minify+concat, compress images, watching for changes)
// Определяем зависимости в переменных
var gulp = require('gulp'),
cache = require('gulp-cache'),
clean = require('gulp-clean'),
stream = require('event-stream'),
size = require('gulp-size'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
minifyCSS = require('gulp-minify-css'),
@danharper
danharper / gulpfile.js
Last active April 11, 2024 08:31
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@winwu
winwu / nginx-laravel-with-apache-default
Last active January 24, 2021 17:09
laravel nginx config file with apache
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/YOUR_PROJECT/public;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name YOUR_IP_OR_DOMAIN;
@Kobold
Kobold / permissions.py
Created April 17, 2015 08:24
IsOwner - Custom django-rest-framework permission to only allow owners of an object to edit it.
from rest_framework import permissions
class IsOwner(permissions.BasePermission):
"""
Custom permission to only allow owners of an object to edit it.
"""
def has_permission(self, request, view):
return request.user and request.user.is_authenticated()
@hirokiky
hirokiky / README.md
Created May 19, 2015 08:46
Proxy server by using aiohttp.

Async Proxy Server

Installation

pip install -r requirements.txt

Run

Run the backend server

70-odd
able
above
abreast
abrupt
absent
abstracted
absurd
accessible
accident
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@xeoncross
xeoncross / Positive-Adjective-List.txt
Created February 23, 2016 19:19
Positive Adjective List
Positive Adjective List
abundant
accessible
accommodative
accomplished
accurate
achievable
adaptable
adaptive
@extremeheat
extremeheat / 0001-Keep-better-track-of-inventory-changes-on-Windows-10.patch
Last active September 11, 2018 13:42
Various Minecraft: Windows 10 Edition-related patches for PocketMine-MP. Must be applied consecutively.
From ee6d6a6154ce35a4945add6aa6bd57f2144b185c Mon Sep 17 00:00:00 2001
From: extremeheat <extreme@protonmail.ch>
Date: Sun, 24 Apr 2016 00:46:33 -0400
Subject: [PATCH 1/4] Keep better track of inventory changes on Windows 10
Edition, fix inventory moving issues
---
src/pocketmine/Player.php | 198 ++++++++++++++++++++-
.../inventory/SimpleTransactionGroup.php | 26 ++-
2 files changed, 221 insertions(+), 3 deletions(-)
@Integralist
Integralist / Python Asyncio Timing Decorator.py
Last active March 17, 2024 10:02
Python Asyncio Timing Decorator
import asyncio
import time
def timeit(func):
async def process(func, *args, **params):
if asyncio.iscoroutinefunction(func):
print('this function is a coroutine: {}'.format(func.__name__))
return await func(*args, **params)
else: