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
class ItemViewComponent extends React.Component {
render() {
return ( <View> {this.displayJsxMessage()} </View> );
}
displayJsxMessage() {
return {this.props.isGreeting && <Text> Hello, JSX! </Text>}
}
}
PARENT
func = (smh) => {
alert(smh)
}
<ChildComponent func={this.func} />
CHILD
pressHandler(smh) {
In web design sometimes you need an «empty» pixel to scale it to the desired length. For this matter I have gathered GIF and PNG both 100% transparent and white (it turns out this has some impact on the file size).
The PNGs have been ran through PNGOutWin. JPEGs I could get were above 1 KiB and for this reason are not considered.
Get all images in this archive.
Details
GIF
The winner is 1-color GIF – 35 bytes. Data URI for white 1×1 image:
@ilhantekir
ilhantekir / gist:7145c9cc7b4f2bc44ae10b466f905e07
Created November 22, 2018 11:14
JQuery to check for duplicate ids in a DOM
$('[id]').each(function(){
var ids = $('[id="'+this.id+'"]');
if(ids.length>1 && ids[0]==this)
console.warn('Multiple IDs #'+this.id);
});
@ilhantekir
ilhantekir / README.md
Created December 31, 2018 08:48 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

git rm -r --cached .
git add .
git commit -am 'git cache cleared'
git push
@ilhantekir
ilhantekir / get-first-category.php
Created February 3, 2019 10:17 — forked from hslaszlo/get-first-category.php
Get first category name or id from wordpress post
<?php
// in the loop
$category = get_the_category();
$currentcat = $category[0]->cat_ID;
$currentcatname = $category[0]->cat_name;
$currentcatslug = $category[0]->slug;
// outside the loop
global $post;
$categories = get_the_category($post->ID);
@ilhantekir
ilhantekir / remove_checkout_fields.php
Created February 6, 2019 07:19 — forked from cryptexvinci/remove_checkout_fields.php
Remove fields from WooCommerce checkout page.
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
// remove billing fields
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
curl -H "Accept-Encoding: gzip" -I https://blababalabla.com/js/homePage.js