Skip to content

Instantly share code, notes, and snippets.

View btk's full-sized avatar
🌳

Burak Tokak btk

🌳
View GitHub Profile
const http = require('http');
const url = 'https://tenta.me/XXXXXX';
const options = {
method: 'POST',
headers: {
"Content-Type": "application/json; charset=utf-8"
}};
const request = http.request(url, options, (response) => {
const tmi = require("tmi.js");
const options = {
options: {
debug: true,
},
connection: {
cluster: "aws",
reconnect: true
},
@btk
btk / js-rn-expo-stored-api.js
Created December 21, 2017 21:52
Generic stored api file for react native expo project.
import Storage from 'react-native-storage';
import { AsyncStorage } from 'react-native';
var EventEmitter = require('events').EventEmitter;
EventEmitter.defaultMaxListeners = 40;
import { Segment } from 'expo';
Segment.initialize({androidWriteKey: "xxx", iosWriteKey: "xxx"});
const _FLUSH = false;
// Flush all user generated data to assigned currents
var fs = require("fs");
var mysql = require("mysql");
var request = require("request");
var http = require("http");
function uniqueid() {
// desired length of Id
var idStrLen = 10;
// always start with a letter -- base 36 makes for a nice shortcut
var idStr = (Math.floor((Math.random() * 25)) + 10).toString(36);
//: Playground - noun: a place where people can play
import UIKit
var asd = 1;
var qwe = "qwe \(asd)";
var asd2 = 1;
var ewr2 = 123;
@btk
btk / RSScrawler.js
Last active August 3, 2016 09:21
RSScrawler.js (via Json)
var getJSON = function(url, callback) {
var xhr = new XMLHttpRequest();
xhr.open("get", url, true);
xhr.responseType = "json";
xhr.onload = function() {
var status = xhr.status;
if (status == 200) {
callback(null, xhr.response);
} else {
callback(status);
<?php
$rssLink = "http://forum.fitekran.com/kategori/-/index.rss"; // Your URL
$PostLimit = 8; // Limit of posts that will be crawled.
$RSSArr = json_decode(file_get_contents("http://rss2json.com/api.json?rss_url=".urlencode($rssLink)));
//Using rss2json.com API
$i = 0;
foreach($RSSArr->items as $rssFeedObj){
if($i < $PostLimit){
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
sudo nano /etc/apache2/mods-enabled/dir.conf
"<IfModule mod_dir.c>
sudo apt-get install autojump
sudo apt-get install ctags
sudo apt-get install cmake
sudo apt-get install vim
sudo apt-get install build-essential
sudo apt-get install shutter
sudo apt-get install gimp
sudo apt-get install vlc