Skip to content

Instantly share code, notes, and snippets.

View frknbasaran's full-sized avatar
🐝

Furkan Başaran frknbasaran

🐝
View GitHub Profile
@frknbasaran
frknbasaran / prog.cpp
Last active September 28, 2017 18:57
Read some text from txt and write it into another one w/ c++.
/*
Import dependencies
*/
// input output stream library
#include <iostream>
// string library for get line as a string from file
#include <string>
// included for streaming validate function
#include <sstream>
@frknbasaran
frknbasaran / api.js
Created September 18, 2017 00:26
plugin/api/api.js
var plugin = {},
common = require('../../../api/utils/common.js'),
countlyCommon = require('../../../api/lib/countly.common.js'),
plugins = require('../../pluginManager.js');
(function (plugin) {
function getPeriodObj(params) {
params.qstring.period = params.qstring.period || "month";
if (params.qstring.period && params.qstring.period.indexOf(",") !== -1) {
header("Content-type: text/xml; charset=utf-8");
if($_POST) {
$x = $_POST['x'];
$y = $_POST['y'];
$response = '<?xml version="1.0" encoding="utf-8"?>';
$response .= '<response><x>'.$x.'</x>';
$response .= '<y>'.$y.'</y></response>';
echo $response;
$(function() {
function init5() {
$('#bes').draggable({
cursor: 'move',
containment: 'document',
stop: handleDragStop
});
}
function handleDragStop(event, ui) {
@frknbasaran
frknbasaran / date modifier
Created November 3, 2015 09:11
convert from 2015-11-02 13:20:56.387Z to 02/11/2015 13:20:56
module.exports = function (date) {
var year = date.substr(0,4);
var month= date.substr(5,2);
var day = date.substr(8,2);
var h = date.substr(11,2);
var m = date.substr(14,2);
var s = date.substr(17,2);
return day + "/" + month + "/" + year + " " + h + ":" + m + ":" + s;
}
<?php
// As they have come, so they will go.
// - Kemal Ataturk, Istanbul, 13 Nov 1918
$app->get('/occupy-bosphorus', function() use ($ataturk) {
$ataturk->redirect($_SERVER["HTTP_REFERER"]);
});
?>