Skip to content

Instantly share code, notes, and snippets.

View ilhantekir's full-sized avatar
🏠
Working from home

ilhan Tekir ilhantekir

🏠
Working from home
  • Erka Grup
  • istanbul
View GitHub Profile
/* Gmail style scrollbar */
::-webkit-scrollbar {
width: 12px
}
::-webkit-scrollbar-thumb {
border-width: 1px 1px 1px 2px
}
::-webkit-scrollbar-track {
border-width: 0
}
/**
* Continents and Countries MySQL Tables compiled from Wikipedia, Braintree Payments documentation
* and a couple other places I don't recall at the moment. This data is compatible with the Braintree
* Payment API as of Dec 2011
*
* Compiled by Steve Kamerman, 2011
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
@ilhantekir
ilhantekir / oocss-space-output.css
Created February 2, 2017 14:17 — forked from syahrasi/oocss-space-output.css
OOCSS Space Helpers
/*
https://github.com/stubbornella/oocss/blob/master/core/spacing/space.css
p,m = padding,margin
a,t,r,b,l,h,v = all,top,right,bottom,left,horizontal,vertical
s,m,l,n = small(5px),medium(10px),large(20px),none(0px)
*/
.ptn, .pvn, .pan { padding-top: 0px !important; }
.pts, .pvs, .pas { padding-top: 5px !important; }
@ilhantekir
ilhantekir / index.html
Created July 11, 2017 05:23
Simples MVVM Example with Javascript
<!--
English:
This example show how do a simple MVVM code with html+js
You can change the data in design and the object person will be changed, you can too make the change by the console(js) of the property from the object and the visual will be changed.
Portugues:
Esse exemplo mostra como fazer um simples MVVM framework com HTML e JS
Você pode alterar os dados visualmente e o objeto pessoa vai ser alterado e também se você fizer a alteração via console da propriedade o visual será modificado.
-->
<!DOCTYPE html>
<html>
@ilhantekir
ilhantekir / canvas-upload.php
Created July 16, 2017 12:35 — forked from fazlurr/canvas-upload.php
Function to save base64 image to png with PHP
<?php
// requires php5
define('UPLOAD_DIR', 'images/');
$img = $_POST['img'];
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$file = UPLOAD_DIR . uniqid() . '.png';
$success = file_put_contents($file, $data);
print $success ? $file : 'Unable to save the file.';
$(“[attribute|=’value’]”) — The “attribute contains prefix selector” returns all elements with attributes whose value is equal to or starts with the given string followed by a hyphen.
$(“[attribute*=’value’]”) — This “attribute contains selector” returns all elements with attributes whose value contains the given substring. The location of the value doesn’t matter. As long as it matches with the given value the selector will select the element.
$(“[attribute~=’value’]”) — This selector returns all elements with attributes whose value contains a given word delimited by spaces.
$(“[attribute$=’value’]”) — This selector returns all elements with attributes whose value ends with the given string.
$(“[attribute=’value’]”) — This selector returns all elements with attributes whose value is exactly equal to a given string.
@ilhantekir
ilhantekir / domIsReady.js
Created January 15, 2018 06:26 — forked from devbyray/domIsReady.js
Vanilla JavaScript Document Ready (Cross-Browser)
var domIsReady = (function(domIsReady) {
var isBrowserIeOrNot = function() {
return (!document.attachEvent || typeof document.attachEvent === "undefined" ? 'not-ie' : 'ie');
}
domIsReady = function(callback) {
if(callback && typeof callback === 'function'){
if(isBrowserIeOrNot() !== 'ie') {
document.addEventListener("DOMContentLoaded", function() {
return callback();

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
@ilhantekir
ilhantekir / Events bound on an element with jQuery
Last active May 16, 2018 12:10
Events bound on an element with jQuery
// Bind up a couple of event handlers
$("#foo").on({
click: function(){ alert("Hello") },
mouseout: function(){ alert("World") }
});
// Lookup events for this particular Element
$._data( $("#foo")[0], "events" );
@ilhantekir
ilhantekir / toggle-remote-styles.js
Created July 28, 2018 11:56 — forked from gauntface/toggle-remote-styles.js
A book marklet to toggle styles.
javascript:(function(){var styles = document.querySelectorAll('link[rel=\'stylesheet\']'); for (var s = 0; s < styles.length; s++) {styles[s].mediax = styles[s].media;if (styles[s].media === 'only x') { styles[s].media = styles[s].mediax; } else if (styles[s].media !== 'print') {styles[s].media = 'only x';}}})();