Skip to content

Instantly share code, notes, and snippets.

View hto's full-sized avatar
👀
./hto

Halil Tuğcan Özaktaş hto

👀
./hto
View GitHub Profile
@hto
hto / lets.go
Created July 19, 2017 12:07 — forked from cptangry/lets.go
Tek dosyada Go dilinin temel konuları ve örnekler
package main //Çalıştrılacak her Go kaynak dosyasında yer almalıdır.
// Go Dilinde tek satırlık yorum/açıklama
import (
"fmt" // Standart kütüphaneyi projemize dahil ettik
"io/ioutil" // Temel io işlemleri
"log" // log
"math" // Matematiksel işlem ve değer tanımlarını içeren kütüphaneyi içe aktardık
"net/http"
"os" // İşletim sistemi işlemleri
@hto
hto / main.go
Last active October 26, 2017 08:50
user_data | go run main.go -redisPort=6379 -redisQPort=6379 -mysqlHost=localhost -mysqlUsername=root -mysqlPassword=root -mysqlDB=headball -mysqlPort=8889
package main
import (
"io"
"os"
"time"
"flag"
"strings"
"log"
"encoding/json"
@hto
hto / main.go
Last active October 26, 2017 07:52
users | go run main.go -mysqlHost=localhost -mysqlUsername=root -mysqlPassword=root -mysqlDB=headball -mysqlPort=8889
package main
import (
"io"
"os"
"time"
"flag"
"strings"
"log"
"encoding/json"
@hto
hto / run.js
Last active December 24, 2017 17:48
Slack Bot RTM Örneği
var SlackClient = require('@slack/client');
var RtmClient = SlackClient.RtmClient;
var CLIENT_EVENTS = SlackClient.CLIENT_EVENTS;
var RTM_EVENTS = SlackClient.RTM_EVENTS;
var rtm = new RtmClient('BOT_TOKEN'); // TODO ::
// RTM.AUTHENTICATED
rtm.on(CLIENT_EVENTS.RTM.AUTHENTICATED, function(rtmStartData) {
console.log(rtmStartData);
});
@hto
hto / rtm_response.json
Created December 24, 2017 17:53
SlackRTM Response Json Example
{
"ok": true,
"url": "wss:\/\/ms9.slack-msgs.com\/websocket\/7I5yBpcvk",
"self": {
"id": "U023BECGF",
"name": "bobby",
"prefs": {
...
},
@hto
hto / nginxproxy.md
Created December 30, 2017 17:04 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@hto
hto / handler.js
Created December 31, 2017 10:57 — forked from jeffrafter/handler.js
Simple HTTP Server and Router in node.js
exports.createHandler = function (method) {
return new Handler(method);
}
Handler = function(method) {
this.process = function(req, res) {
params = null;
return method.apply(this, [req, res, params]);
}
}
@hto
hto / jms_1.php
Last active January 18, 2018 12:23
JmsSerializer
<?php
/**
*
*/
public function saveAction(Request $request)
{
$serializer = $this->get('jms_serializer');
$content = json_decode($request->getContent(), true);
@hto
hto / jms.html
Last active January 18, 2018 12:37
Angular Ng-model Simple
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
Name: <input ng-model="title"> <br />
Content: <input ng-model="content">
</div>
echo "İlk satırım - ";
echo "İkinci satırım - ";
echo "Üçüncü satırım - ";
goto a;
echo "Beşinci satırım - ";
echo "Altıncı satırım - ";
a:
echo "Son Satır";