Skip to content

Instantly share code, notes, and snippets.

View ustun's full-sized avatar

Ustun Ozgur ustun

View GitHub Profile
[ignore]
.*/node_modules/fbjs/.*
.*/node_modules/flux/.*
.*/node_modules/npm/.*
.*/node_modules/babylon/.*
[options]
module.name_mapper='.*\(.less\)' -> 'empty/object'
module.name_mapper='.*\(.css\)' -> 'empty/object'
module.system.node.resolve_dirname=node_modules
class DatabaseLoggingMiddleware(object):
def process_request(self, request):
request.start_time = time.time()
def process_response(self, request, response):
if 'content-type' in response._headers and response._headers['content-type'][1].startswith('application/json') and response.status_code == 200:
end_time = time.time()
total_execution_time_msec = int((end_time - request.start_time) * 1000)
Some Notes on Django and Celery Logging:
1. logging_tree is very useful. logging_tree.print_output()
2. Celery by defaults hijacks the logger, and overwrites its handler and formatter.
You can set it to not hijack, in which case the root logger will be preserved, except for its level.
The level of the root logger is still hijacked by the celery process.
3. Django has its own default logging, which is merged with our logging. To disable old logging,
@ustun
ustun / eslint-auto.el
Created January 12, 2016 23:59
run eslint --fix on emacs file save
;;; runs eslint --fix on the current file after save
;;; alpha quality -- use at your own risk
(defun eslint-fix-file ()
(interactive)
(message "eslint --fixing the file" (buffer-file-name))
(shell-command (concat "eslint --fix " (buffer-file-name))))
(defun eslint-fix-file-and-revert ()
(interactive)
@ustun
ustun / index.js
Created January 12, 2016 23:25
requirebin sketch
var deasciifier = require('turkish-deasciifier');
var deascii = new deasciifier();
console.log(deascii.deasciify("Turkce guzel bir dildir."));
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
@ustun
ustun / react form example.js
Created November 12, 2015 15:18
react form example
var Utils = require('Utils');
var TestForm = React.createClass({
onSubmit(e) {
e.preventDefault();
this.setState({submitAttempted: true});
if (!this.state.inProgress) {
@ustun
ustun / gist:efc93b9668dbeabbf809
Last active August 29, 2015 14:22
React Eğitim ve Çalıştayı

React Eğitimi ve Çalıştayı

Önemli Not: Yoğun ilgi üzerine kayıtlarımız dolmuş durumda. Ancak kayıt olup da gelmeyecekler olabilir. Bu nedenle gelmek isteyenler lütfen bekleme listesine (waitlist) kayıt olsun, yer açıldıkça haberdar edileceklerdir.

Yazane işbirliği ile düzenleyeceğimiz bu eğitimde Üstün Özgür Yazılım olarak Facebook'un React kütüphanesi üzerine ayrıntılı bir eğitim ve çalıştay vereceğiz. Etkinlik hem eğitim hem de katılımcıların bazı örnekleri geliştirdiği bir çalıştay şeklinde gerçekleşecek.

Etkinliğin iki temel amacı olacak: Birincisi React kullanımının Türkiye'de yaygınlaşmasını sağlamak. İkincisi de Üstün Özgür Yazılım olarak, React ve JavaScript konusunda hevesli çalışma arkadaşları bulmak. Lütfen iş ilanı ile ilgili olarak https://gist.github.com/ustun/5ee3250acf938e4115c6 adresindeki bilgileri inceleyin.

Etkinlik kaydı için lütfen şu adresi ziyaret edin: http://bit.ly/reactegitim

@ustun
ustun / gist:8b907ff63693105e5312
Last active September 9, 2016 20:12
Requirements and Recommendations for React Workshop

Requirements for React Workshop

For any questions, email me at ustun@ustunozgur.com

Software:

node.js or io.js should be installed.

Node modules to install:

@ustun
ustun / gist:d8a8dc9161dff9049e25
Last active August 29, 2015 14:21
Ustun Ozgur Software Job Description

As Ustun Ozgur Software, we are looking for talented JavaScript and Python software developers to join our team in our new Istanbul office in the Karakoy area.

Our primary client is SellerCrowd, a venture-backed professional network site for the advertising industry. SellerCrowd serves over 20k members and has a large and growing base of paying subscribers to the service.

We are looking for talented and curious software developers. We are open to people of all experience levels. Our focus is building a software team where we can improve and learn together. We value a balanced and peaceful working environment.

The current software stack is built with Django on the backend and React on the frontend. We are looking for people with experience in these or similar libraries and a consistent focus on improving their skills.

The other tools we are using consist of Postgresql for database, RabbitMQ through Celery for task management and ElasticSearch and Redis for some other features. Because SellerCrowd is based