Skip to content

Instantly share code, notes, and snippets.

View stnc's full-sized avatar
🎯
Focusing

TUNÇ Selman stnc

🎯
Focusing
View GitHub Profile
@stnc
stnc / tumblr tema kode.html
Created May 14, 2020 01:56
tumblr tema kode
<html lang="en">
<head>
<meta https-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{Title}{block:SearchPage} ({lang:Search results for SearchQuery}){/block:SearchPage}{block:PostSummary} ({PostSummary}){/block:PostSummary}</title>
<meta name="description" content="{block:IndexPage}{block:Description}{MetaDescription}{/block:Description}{/block:IndexPage}{block:PermalinkPage}{PostSummary}{/block:PermalinkPage}" />
<meta name="author" content="Peter Vidani">
<meta name="if:Show note count" content="1">
@stnc
stnc / test_a_sayer.go
Created March 4, 2020 01:15 — forked from deinspanjer/test_a_sayer.go
Example of cross-package interfaces in golang
package a
import "fmt"
type Sayer interface {
Say() string
}
type Formal struct{}
@stnc
stnc / interfacev1.go
Last active February 26, 2020 20:34
A Real-World Example of Go Interfaces
package main
// author Dirk Hoekstra
//link https://medium.com/better-programming/a-real-world-example-of-go-interfaces-98e89b2ddb67
import "fmt"
type User1 struct {
Name string
@stnc
stnc / function.php
Last active December 31, 2019 06:15
worpress Like WP REST API
<?php
/*****************************************************************
** Like WP REST API -start *******
******************************************************/
/**
*
* Registers REST API endpoints
*
@stnc
stnc / README.md
Created December 24, 2019 04:27 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@stnc
stnc / function.php
Last active December 22, 2019 01:50
wordpress categories with it depends posts (for api)
<?php
/**
* uses : http://examplewp.com/wp-json/wp/v2/categoriesAndDepencyPostList
* Registers REST API endpoints -- for accordion tab and categories with it depends posts
*
* @since 1.0.0
*/
add_action('rest_api_init', 'register_categoriesAndDepencyPostList1');
function register_categoriesAndDepencyPostList1()
{
@stnc
stnc / file.md
Last active October 28, 2019 03:52
golang, react, git Style Guide List
@stnc
stnc / dynamicState.js
Last active September 19, 2019 22:55
react native and react dynamic state create
import React, { Component } from 'react';
import { View, TouchableHighlight, Text, StyleSheet, Dimensions } from 'react-native';
export default class About extends Component {
static navigationOptions = ({ navigation }) => ({
title: 'Biyo Güvenlik Hakkında',
});
@stnc
stnc / simulatePress.js
Last active September 19, 2019 15:22
React-native, render a button click dynamically
/*
want to generate a button click dynamically for a TouchableOpacity in react-native, i didn't find anything about that,
all i want is to call the TouchableOpacity onPress from a fuction (or see its effect on the button)
in titanium we were doing $.button.click i tried using Animated but no luck https://facebook.github.io/react-native/docs/animations.html
so can anybody help? thanks in advance
*/
import React, { Component } from 'react';
@stnc
stnc / functions.php
Last active September 19, 2019 23:53
wordpress ulike rest api add-on -- https://wordpress.org/plugins/wp-ulike/
<?php
//ulike add post
add_action('rest_api_init', 'stnc_register_ulike');
function stnc_register_ulike() {
register_rest_field('post', '_liked', array('get_callback' => 'stnc_get_ulike', 'update_callback' => 'stnc_update_ulike', 'schema' => null,));
}
/**
* Handler for getting custom field data.
*/
function stnc_get_ulike($object, $field_name, $request) {