Skip to content

Instantly share code, notes, and snippets.

View schfkt's full-sized avatar
💪

Pavel Ivanov schfkt

💪
View GitHub Profile
@schfkt
schfkt / random-path-url.lua
Created May 12, 2020 09:53 — forked from shyuan/random-path-url.lua
Random path benchmark Lua script for wrk
-- https://github.com/wg/wrk
-- wrk -c 1000 -d 10s -s random-path-url.lua http://localhost:8080
local paths = {
"/path1.txt",
"/path2.txt",
"/path3.txt",
"/path4.txt",
"/path5.txt",
"/path6.txt"
@schfkt
schfkt / kubernetes_commands.md
Created August 13, 2018 06:45 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
@schfkt
schfkt / restricted-psp.yaml
Created August 3, 2018 17:16 — forked from tallclair/restricted-psp.yaml
Restricted PodSecurityPolicy
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: restricted
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
spec:
@schfkt
schfkt / nodemon.json
Created February 24, 2017 20:46
Nodemon sample config
{
"ignore": [
".git",
"node_modules",
".idea"
],
"verbose": true,
"ext": "js"
}
@schfkt
schfkt / gulpfile.js
Created October 24, 2016 09:49
Gulp config for a simple frontend development process
var gulp = require('gulp');
var clean = require('gulp-clean');
var replace = require('gulp-replace');
var concat = require('gulp-concat-css');
var watch = require('gulp-watch');
var batch = require('gulp-batch');
var plumber = require('gulp-plumber');
var csscomb = require('gulp-csscomb');
var BUILD_DIR = '../done';
@schfkt
schfkt / better-nodejs-require-paths.md
Created June 14, 2016 11:13 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@schfkt
schfkt / profiler.js
Last active January 8, 2016 11:31
Mongodb profiler's output
{
"op" : "getmore",
"ns" : "some.namespace",
"query" : {
"some": "query"
},
"cursorid" : NumberLong(6375683362946191350),
"ntoreturn" : 0,
"keyUpdates" : 0,
"numYield" : 773,
@schfkt
schfkt / away.applescript
Last active December 21, 2015 18:49 — forked from andreyfedoseev/away.applescript
AppleScript to set Away status in Skype and Adium (for Alfred)
on alfred_script(q)
tell application "Adium" to go away
tell application "Skype"
send command "SET USERSTATUS AWAY" script name "Alfred"
end tell
end alfred_script
@schfkt
schfkt / osx-for-hackers.sh
Last active August 29, 2015 14:27 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@schfkt
schfkt / JS-error-tracking-with-GA.js
Last active November 18, 2021 21:54
Track JavaScript errors using Universal Analytics from Google.
function trackJavaScriptError(e) {
var ie = window.event || {};
var message = e.message || ie.errorMessage || '<no message>'
var filename = e.filename || ie.errorUrl || '<no filename>';
var lineno = e.lineno || ie.errorLine || '<no lineno>';
var colno = e.colno || ie.errorColumn || '<no colno>';
var source = filename + ':' + lineno + ':' + colno;
ga('send', 'event', 'JavaScript Exception', message, source, {'nonInteraction': 1});
}