Skip to content

Instantly share code, notes, and snippets.

View ustun's full-sized avatar

Ustun Ozgur ustun

View GitHub Profile
@ustun
ustun / gist:5ee3250acf938e4115c6
Last active March 20, 2019 14:20
Ustun Ozgur Yazilim Is Ilani

Not: Mart 2016 itibariyle aşağıdaki ilan geçersizdir. Şu an için açık pozisyon bulunmamaktadır.

@ustun
ustun / gist:5670b7480569fbb784a4
Created April 14, 2015 14:41
NavigatorIOS bug
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
Navigator,
/*global Immutable*/
var raw_urls = _.range(1, 5).map(function (i) {
return {id: i, url: "url.com" + i, title: "Title of " + i, content: "Content of " + i};});
var some_map = _.object(_.map(raw_urls, function(item) {
return [item.id, item];
}));
@ustun
ustun / gist:523bab8ea50b1cf7aa52
Created November 23, 2014 18:47
Download all Clojure/conj 2014 videos
youtube-dl -citk --max-quality mp4 http://www.youtube.com/playlist?list=PLZdCLR02grLoc322bYirANEso3mmzvCiI
@ustun
ustun / gist:0f1a86142b95a391773c
Created October 30, 2014 11:19
cider print defun to repl
(defun cider-eval-defun-at-point-in-repl ()
(interactive)
(let ((form (cider-defun-at-point)))
;; Strip excess whitespace
(while (string-match "\\`\s+\\|\n+\\'" form)
(setq form (replace-match "" t t form)))
(cider-switch-to-current-repl-buffer)
;;(set-buffer (cider-find-or-create-repl-buffer))
(goto-char (point-max))
@ustun
ustun / gist:7cba642ffc71628df863
Created October 25, 2014 10:27
Handling forms with react
# How to handle forms with React
1- Save all raw values in state, never read from dom using getdomnode.
2- Do not save whether the value is valid or not in state. This is the most
important point. Whether a form is valid or not can be inferred from state
form variables during render. So, we never have a state variable like
formValid. Otherwise, it can go out of sync.
3- Showing errors: We initially do not want to show the errors, even if the
@ustun
ustun / gist:0c2bb78b27309849b25b
Created August 15, 2014 20:01
emacs packages
./4clojure-20131014.1507
./ac-python-20110519
./ace-jump-mode-20140616.115
./ack-and-a-half-20130815.1917
./anzu-20140703.2228
./archives
./auto-complete-20140803.2118
./blank-mode-20130824.1159
./browse-kill-ring-20140807.720
./buffer-move-20140522.58
@ustun
ustun / boot2docker notes for OS X.md
Last active March 2, 2018 03:37
boot2docker notes for OS X

This document contains some notes I have gathered while I was trying to setup a redis service using boot2docker running on OS X. This won't cover what Docker is, see Docker website for details.

Installing boot2docker

First, install Virtualbox and follow the steps at http://docs.docker.com/installation/mac/

Since Docker only runs on Linux, boot2docker runs a virtual machine in Virtualbox (or VMWare etc), however you can run the docker command on OS X

@ustun
ustun / spinning_mixin.js
Created June 5, 2014 12:01
react spinning mixin
// include http://fgnass.github.io/spin.js/jquery.spin.js first
var SpinningMixin = {
componentWillUpdate: function (nextProps, nextState) {
if (this.state.inProgress && !nextState.inProgress) {
this.stopSpinning();
}
if (!this.state.inProgress && nextState.inProgress) {
@ustun
ustun / gist:7b5d2fffa77aa63c24bf
Last active August 29, 2015 14:02
react django
{# react_component.html #}
{% comment %}
Template for a custom template tag for a React component. Includes the jQuery DOM ready call
Props:
- id
- js_mount_callback_name that takes a jquery selector and mounts the component
{% endcomment %}