Skip to content

Instantly share code, notes, and snippets.

View ekinertac's full-sized avatar
🥳

Ekin Ertaç ekinertac

🥳
View GitHub Profile
<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 / 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",
# 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 ->
@ekinertac
ekinertac / caps_lock-ctrl_remap.md
Last active December 6, 2015 22:56 — forked from duggiefresh/crunchbang_hack_1.md
CrunchBang 11: Remap Caps Lock to CTRL

CrunchBang 11: Remap Caps Lock to CTRL

$ vim ~/.Xmodmap

remove Lock = Caps_Lock
remove Control = Control_L
keysym Caps_Lock = Control_L
add Control = Control_L
@ekinertac
ekinertac / field_blank_null.md
Last active April 15, 2024 08:38
Django null/blank field explanation
Fields null=True blank=True
CharField, TextField, SlugField, EmailField, CommaSeparatedIntegerField DON'T Django's convention is to store empty values as the empty string, and to always retrieve NULL or empty values as the empty string for consistency. OK Do this if you want the corresponding form widget to accept empty values. If you set this, empty values get stored as empty strings in the database.
BooleanField DON'T Use NullBooleanField instead. DON'T
IntegerField, FloatField, DecimalField OK If you wabt to be able to set the value to NULL in the database OK if you want the corresponding form widget to accept empty values. if so out will also want to set null=True
DateTimeField, DateField, TimeField OK if you want to be able to set the value to NULL in the database. OK If you want the corresponding form widget to accept empty values, or if you are using auto now or auto now add. If so, you will al
@ekinertac
ekinertac / ftp.py
Created October 1, 2015 12:19
Temporary FTP Server
#!/usr/bin/env python
# ftpserver-cli.py
import sys
sys.path.append("/home/ekinertac") # enter your proper path here
import argparse
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
@ekinertac
ekinertac / Comments.md
Last active August 29, 2015 14:27
FF Feature List

Comments Control

  • Create

    • should create a comment with a valid user
    • should not create a comment for an invalid user
    • should not create a comment for an invalid post in a group
    • should not update group's last activity
  • Update

    • should update a comment with a valid user
  • should not update a comment with a invalid user

@ekinertac
ekinertac / gist:edd241e35fbdb076574b
Created May 4, 2015 12:13
deferred angular request
params.callback = 'JSON_CALLBACK';
// Create promise
var deffered = $q.defer();
// Do request
$http({
method: 'JSONP',
url: 'http://www.example.com/rest-api',
@ekinertac
ekinertac / bower.py
Last active August 29, 2015 14:01
Django custom template tag for bower.js
import json
import os
from classytags.arguments import Argument
from classytags.core import Tag, Options
from django import template
from django.conf import settings
register = template.Library()