Skip to content

Instantly share code, notes, and snippets.

View Enelar's full-sized avatar
💭
https://www.linkedin.com/in/offenso

Kirill Berezin Enelar

💭
https://www.linkedin.com/in/offenso
View GitHub Profile
@Enelar
Enelar / squid_cache.conf
Created July 5, 2015 23:48
Force cache cdn squid (32GB of cache)
#
# Recommended minimum configuration:
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
@Enelar
Enelar / lazy_git.sh
Last active October 20, 2015 12:43
Git shortcuts for lazy developers
alias status='git status'
alias commit='git commit'
alias commitall='git commit -a'
alias amend='git commit --amend'
alias amendall='git commit -a --amend'
alias push='git push'
alias pull='git pull'
alias pushforce='git push -f'
alias submodule='git submodule'
alias add='git add'
@Enelar
Enelar / ngnix.conf
Last active August 29, 2015 14:23
Using nginx as forward proxy for bad connection locations
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
# Service Interruption Debrief
## Brief Executive Summary
EXECUTIVE SUMMARY HERE
***On Call during outage***:
***Time outage started***:
@Enelar
Enelar / semanticui_container.css
Created May 22, 2015 15:03
Semantic ui analog of bootstrap container class
.ui.container {
position: relative;
width: 915px;
margin: 0px auto;
}
@media only screen and (max-width : 600px) {
.ui.container {
width: auto;
margin: 0em 1rem;
@Enelar
Enelar / fedora_zram.sh
Last active August 29, 2015 14:21
Enable&autoload zram on fedora
#!/bin/bash
# http://mystilleef.blogspot.ru/2011/10/enable-zram-in-fedora.html
if [ `whoami` != "root" ]; then
echo "Sudo required"
exit
fi
RED='\033[0;31m'
NC='\033[0m' # No Color
@Enelar
Enelar / sublime_text_3.sh
Last active August 29, 2015 14:21
Any yum based linux Sublime Text 3 install (into /opt with current user shortcut)
#!/bin/bash
# http://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux
RED='\033[0;31m'
NC='\033[0m' # No Color
printf "${RED}Check&install required utility${NC}\n"
rpmqa=`rpm -qa`
echo $rpmqa | grep -qw lynx || sudo yum install lynx
echo $rpmqa | grep -qw wget || sudo yum install wget
@Enelar
Enelar / selection_sort.asm
Created January 24, 2015 13:09
One friend asked help with home work. Its crappy snippet perform selection sort.
.686
.model flat
.stack
data segment "data"
data ends
.CODE
@Enelar
Enelar / constexpr_string.cpp
Created August 12, 2014 19:01
Simple constexpression string container
// Introduced by Scott Schurr in "C++ Now! 2012"
class constexpr_string
{
protected:
const char* const p;
const std::size_t s;
public:
template<std::size_t N>
constexpr constexpr_string(const char(&a)[N])
: p(a), s(N-1)
@Enelar
Enelar / clone.js
Created July 11, 2014 05:33
Emulate clone constructor in js
function CloneObject(obj)
{
if (obj === null)
return obj;
if (typeof obj !== "object")
return obj;
var copy = obj.constructor();
for (var attr in obj)
if (obj.hasOwnProperty(attr))