Skip to content

Instantly share code, notes, and snippets.

View mikeyakymenko's full-sized avatar
🏠
Working from home

Mike Yakymenko mikeyakymenko

🏠
Working from home
View GitHub Profile
@mikeyakymenko
mikeyakymenko / postgres-brew.md
Created June 7, 2017 07:32
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@mikeyakymenko
mikeyakymenko / A.markdown
Created September 20, 2016 10:28 — forked from larrybotha/A.markdown
Custom social sharing icons
@mikeyakymenko
mikeyakymenko / README.md
Created September 14, 2016 12:55 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@mikeyakymenko
mikeyakymenko / forms.py
Created June 13, 2016 11:46 — forked from amatellanes/forms.py
A Yes/No field for Django.
from django import forms
class Form(forms.Form):
field = forms.TypedChoiceField(coerce=lambda x: x =='True',
choices=((False, 'No'), (True, 'Yes')))
@mikeyakymenko
mikeyakymenko / gist:27547cd2e8dfc1430d173dd50df46bc5
Created April 7, 2016 21:03 — forked from Atem18/gist:4696071
Tutorial to seting up a django website in production.

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@mikeyakymenko
mikeyakymenko / README.md
Created September 30, 2015 13:44 — forked from nicerobot/README.md
Mac OS X uninstall script for packaged install of node.js

To run this, you can try:

curl -ks https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh

var getRandomColor = function() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
@mikeyakymenko
mikeyakymenko / gist:27c305907d812d86525b
Created August 12, 2015 23:42
JavaScript: Split array in chunks
function arCunks(list, pieces) {
pieces = pieces || 2;
var len = list.length;
var mid = (len/pieces);
var chunks = [];
var start = 0;
for(var i=0;i<pieces;i++) {
var last = start+mid;
if (!len%pieces >= i) {
last = last-1
matrix = [[1, 2, 3, 5], [4, 5, 6, 32], [7, 8, 9, 44]]
d_positiv = [matrix[i][i] for i in range(len(matrix))]
d_negative = [matrix[i][-i-1] for i in range(len(matrix))]
d_positiv = [line[i] for i, line in enumerate(matrix)]
d_negative = [line[-i-1] for i, line in enumerate(matrix)]
find . -name "*.pyc" -exec rm -rf {} \;