Skip to content

Instantly share code, notes, and snippets.

View ekinertac's full-sized avatar
🥳

Ekin Ertaç ekinertac

🥳
View GitHub Profile
@ekinertac
ekinertac / pyenv+virtualenv.md
Created June 1, 2018 12:19 — forked from eliangcs/pyenv+virtualenv.md
Cheatsheet: pyenv, virtualenvwrapper, and pip

Cheatsheet: pyenv, virtualenvwrapper, and pip

Installation (for Mac OS)

Install pyenv with brew

brew update
brew install pyenv
@ekinertac
ekinertac / sqlite3_to_mysql.md
Last active April 11, 2018 03:48
Converts sqlite3 database dumps to mysql dump format
sqlite3 databse.db .dump > sqlite3_database_dump.sql
python sqlite3_to_mysql.py database.sql > mysql_database_dump.sql
@ekinertac
ekinertac / s3storages.settings.py
Last active April 11, 2018 03:47
Django's Amazon S3 Configuration
#
# Install django-storages app with pip
# $ pip install django-storages
#
INSTALLED_APPS = (
...
'storages',
...
)
<html>
<head>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Raleway:100,200,300" rel="stylesheet">
<style>
body {
background-image: url("http://static.simpledesktops.com/uploads/desktops/2014/10/15/tetons-at-night.png");
background-size: cover;
color: rgba(255,255,255,.5);
@ekinertac
ekinertac / commands.sh
Last active October 31, 2016 12:27
MySQL pid file permisson error solution
############################
# TRY LINE 33 and 34 BEFORE RUN THIS !!!!
############################
mysqldump --all-databases > /tmp/all.mysql.dump.sql
ps -ax | grep mysql
# stop and kill any MySQL processes
brew remove mysql
@ekinertac
ekinertac / server.sh
Last active October 16, 2016 00:28
New linux configuration
apt-get update
apt-get install build-essential \
python-dev \
libgdbm-dev \
libbz2-dev \
libc6-dev \
libsqlite3-dev \
libssl-dev \
libreadline-dev \
@ekinertac
ekinertac / user.py
Created May 12, 2013 21:45
Django: Custom User Model
# models.py
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager
class Profile(AbstractBaseUser, PermissionsMixin):
username = models.CharField(
'username',
max_length=30,
unique=True,
@ekinertac
ekinertac / Preferences.sublime-settings
Created July 13, 2016 17:44
Sublime Text default settings for OSX
{
"color_scheme": "Packages/Theme - Brogrammer/brogrammer.tmTheme",
"font_face": "Inconsolata",
"font_size": 13,
"margin": 8,
"rulers": [120],
"translate_tabs_to_spaces": true,
"highlight_line": true,
"caret_style": "blink",
@ekinertac
ekinertac / random_color.js
Created February 17, 2013 09:34
random color with javascript
function get_random_color() {
var letters = '0123456789abcdef'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.round(Math.random() * 15)];
}
return color;
}
>>> '#4eb4ad'
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->