Skip to content

Instantly share code, notes, and snippets.

View fatihtoprak's full-sized avatar
🎯
Focusing

Fatih Toprak fatihtoprak

🎯
Focusing
View GitHub Profile
@fatihtoprak
fatihtoprak / 0_reuse_code.js
Created December 13, 2016 18:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@fatihtoprak
fatihtoprak / clear_macos_icon_cacke_and_reload_dock.sh
Last active March 4, 2017 06:07 — forked from fabiofl/gist:5873100
Clear Mac OS X's icon cache. And Reload Dock
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
killall "Dock"
@fatihtoprak
fatihtoprak / taxonomy-{tax-name}.php
Last active March 27, 2017 19:32
Taxonomy loop.
<?php
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
$q = new WP_Query([
'post_type' => 'directory', // replace with yours post type.
'posts_per_page' => get_option('posts_per_page'),
get_query_var( 'taxonomy' ) => get_query_var( 'term' ),
'paged' => $paged
]);
$temp_query = $wp_query;
$wp_query = null;
@fatihtoprak
fatihtoprak / bootstrap-extra.css
Created April 2, 2017 15:24
reset col paddings bootostrap
.row-no-padding > [class*="col-"] {
padding-left: 0 !important;
padding-right: 0 !important;
}
div[class*="col-"] {
padding-left: 0 !important;
padding-right: 0 !important;
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* WordPress Replace Image URL
*
* Replaces image url content of the WordPress post content.
*
* PHP version 5
* WordPress version 3.5
{
"team.showWelcomeMessage": false,
"editor.snippetSuggestions": "top",
"editor.formatOnPaste": true,
"editor.fontSize": 16.3,
"editor.tabSize": 2,
"git.enableSmartCommit": true,
"workbench.colorTheme": "itg dark",
"git.autofetch": true,
"gitlens.advanced.messages": {
@fatihtoprak
fatihtoprak / FacebookDebugger.php
Created January 20, 2018 17:54 — forked from FrostyX/FacebookDebugger.php
Facebook API - Force facebook to reload cache from your website
<?php
class FacebookDebugger
{
/*
* https://developers.facebook.com/docs/opengraph/using-objects
*
* Updating Objects
*
* When an action is published, or a Like button pointing to the object clicked,
* Facebook will 'scrape' the HTML page of the object and read the meta tags.
@fatihtoprak
fatihtoprak / il_ilce_enlem_boylam.sql
Created September 20, 2018 22:35 — forked from ismailbaskin/il_ilce_enlem_boylam.sql
Türkiye İl ve İlçelerin enlem boylam bilgileri
/*
Türkiye İl ve İlçelerin enlem boylam bilgileri (dörtgen olarak sınır pozisyonlarıyla birlikte) kaynak : google maps (başarsoft)
twitter : http://twitter.com/tserpico
*/
DROP TABLE IF EXISTS `pk_il`;
CREATE TABLE `pk_il` (
`il_id` int(2) NOT NULL COMMENT 'plaka kodu',
`il_adi` varchar(255) NOT NULL,
`lat` double(20,8) DEFAULT NULL COMMENT 'enlem',
@fatihtoprak
fatihtoprak / remove_DS_store_files.md
Last active May 24, 2019 07:13
How to remove .DS_Store files.

Tüm DS_Store dosyalarını kaldırma

sudo crontab -e

Vi editor'da klavyenizden bir kez I harfine basın ve aşağıdaki komutu girin:

*/10 * * * * root find / -name ".DS_Store" -depth -exec rm {} \;

  • Bu crontab girişi aşağıdaki formata sahiptir:
@fatihtoprak
fatihtoprak / amp form.md
Last active October 18, 2019 14:31
amp form push

amp form submission

            return response($return, 200)
                ->header("Content-type", "application/json")
                ->header("Access-Control-Allow-Credentials", "true")
                ->header("Access-Control-Allow-Origin", "*.ampproject.org")
                //->header("AMP-Access-Control-Allow-Source-Origin", $ampxhr)
                ->header("Access-Control-Expose-Headers", "AMP-Access-Control-Allow-Source-Origin");