Skip to content

Instantly share code, notes, and snippets.

View onurozkan's full-sized avatar

Onur Özkan onurozkan

View GitHub Profile
@onurozkan
onurozkan / nginx.conf
Created June 18, 2021 14:09 — forked from thoop/nginx.conf
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@onurozkan
onurozkan / _readme.md
Created August 22, 2018 11:21 — forked from lambdahands/_readme.md
FlowType and CSS Modules

Huh?

So basically FlowType doesn't know about CSS Modules, a really handy way of dealing with the plagues of CSS in codebases (global variables and dependency wackiness mainly).

What WebPack allows us to do is "require" CSS files and use their class names:

import styles from "my_styles.css";
import React from "react";
@onurozkan
onurozkan / react-file-upload.js
Last active February 9, 2018 13:50 — forked from AshikNesin/react-file-upload.js
Simple React File Upload
import React from 'react'
import axios, { post } from 'axios';
class SimpleReactFileUpload extends React.Component {
constructor(props) {
super(props);
this.state ={
file:null
}
/* Based on
* - EGM Mathematical Finance class by Enrique Garcia M. <egarcia@egm.co>
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1)
*/
var ExcelFormulas = {
PVIF: function(rate, nper) {
return Math.pow(1 + rate, nper);
},
// The following could have been replaced by setting `Backbone.emulateHTTP = true;`
Backbone._sync = Backbone.sync;
Backbone.sync = function( method, model, options ) {
var beforeSend = options.beforeSend;
options = options || {};
options.success = function(){
options.Count = xhr.getResponseHeader("Count")
}
return Backbone._sync( method, model, options );
/*
* There's a bug in Chrome/Safari using overflow:hidden with border-radius. This mask fixes it.
* Solution: http://stackoverflow.com/questions/5736503/how-to-make-css3-rounded-corners-hide-overflow-in-chrome-opera/10296258#10296258
*/
.masked {
position: absolute;
border-radius: 10px;
overflow: hidden;
/* this fixes the overflow:hidden in Chrome */
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);

Adobe Edge Inspect Used while working on mobile/responsive sites to view natively on iPhone, updates in real time. https://chrome.google.com/webstore/detail/adobe-edge-inspect/ijoeapleklopieoejahbpdnhkjjgddem

Benchwarmer This has replaced my pinned Dribbble tab. "New tab" extension, no URL bar icon, transforms your new tab's background into a list of Dribbble popular/everyone/debut/following (you pick) shots. https://chrome.google.com/webstore/detail/benchwarmer-the-dribbble/lhdjhhpjicomphhjpehdhjenbaamdpnn

Bitly Used with custom .htaccess rule and vanity domain to shorten links with 2 clicks.

@onurozkan
onurozkan / jquery.wrapInChunks.js
Created November 14, 2012 12:48 — forked from seutje/jquery.wrapInChunks.js
Takes a jQuery collection and wraps each x items with element y
/**
* takes a jQuery collection and wraps each x items with element y
* kinda nasty looking though
* Example: $('#foo').children().wrapInChunks('<div></div>', 2);
* would wrap every 2 children of #foo with a div
*/
jQuery.fn.wrapInChunks = function(html, chunkSize) {
chunkSize = chunkSize || 1;
var items = this.get(),
rows = [],
74.125.43.103 youtube.com
74.125.43.103 www.youtube.com
74.125.43.103 www.docs.google.com
74.125.43.103 www.clients1.google.com.tr
74.125.43.103 www.translate.google.com.tr
74.125.43.103 docs.google.com
74.125.43.103 clients1.google.com.tr
74.125.43.103 translate.google.com.tr
74.125.43.105 www.google-analytics.com
74.125.43.105 google-analytics.com
if settings.DEBUG:
urlpatterns += patterns('',
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.MEDIA_ROOT,
'show_indexes': True}
),
(r'(.*\.html)$', 'django.views.generic.simple.direct_to_template'),
)