Skip to content

Instantly share code, notes, and snippets.

@Yengas
Yengas / react-redux.js
Last active April 20, 2018 17:40
Simple React-Redux example with async/sync actions using redux-actions, redux-thunk and react-redux bindings.
import {createStore, bindActionCreators, applyMiddleware} from 'redux'
import {createAction, handleActions} from 'redux-actions'
import thunkMiddleware from 'redux-thunk'
import React from 'react'
import ReactDOM from 'react-dom'
import {Provider, connect} from 'react-redux'
// React classes and rendering...
class MessageApp extends React.Component{
render(){
'use strict';
const https = require("https");
const qs = require("querystring");
const esc = qs.escape;
const crypto = require('crypto');
const HMAC = crypto.createHmac;
class twitter {
constructor(o) {
// if (!o || !o.consumer_key || !o.consumer_secret) throw new Error("Missing Paramaters");
this.id = o.consumer_key;
@Yengas
Yengas / README.md
Created July 17, 2016 21:13
Finding common friends of a given steam users, and creating a graph network.

Steam Friends

This is a simple ruby script to create (in adjacent list format) graph networks of a given array of steam users. You can also use this script to find the most common friends of a given group of users.

Examples

Below are some examples of using this script.

Creating a graph network

outputCSV(createNetwork(['yigitcan2', 'Boneslark']), 'output.csv');
@Yengas
Yengas / jazzradio.bat
Last active October 5, 2016 14:15
Jazz Radio custom player
set STATION="fusionlounge"
IF NOT "%1"=="" (
set STATION=%1
)
echo "JazzRadio.com - %STATION%"
mpv "http://pub6.jazzradio.com/jr_%STATION%_aacplus?type=.flv" --http-header-fields="User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36","Referer: http://www.jazzradio.com/%STATION%","X-Requested-With: ShockwaveFlash/22.0.0.209","Connection: keep-alive"
@Yengas
Yengas / TubitEgitim.cs
Created December 7, 2016 16:03
7 Aralıık 2016 Tübit eğitimi; Arama ve Sıralama algoritmaları
#include <stdio.h>
#include <stdlib.h>
// O(n) ==> n = length
int linear_search(int value, int* arr, int length){
for(int i = 0; i < length; i++)
if(arr[i] == value)
return 1;
return 0;
}
@Yengas
Yengas / countries_and_cities.json
Created December 14, 2016 08:14
Türkçe isimli ülke ve şehirler. 2 Karakterli iso kodları ile birlikte.
[{"code": "AF", "cities": ["As\u00e2d\u00e2b\u00e2d", "\u00c2ybak", "Baghl\u00e2n", "Balkh", "B\u00e2m\u00eey\u00e2n", "Chaghchar\u00e2n", "Ch\u00e2r\u00eek\u00e2r", "Far\u00e2h", "Fayz\u00e2b\u00e2d", "Ghardez", "Ghazni", "Her\u00e2t", "Jal\u00e2l\u00e2b\u00e2d", "K\u00e2bul", "Kh\u00e2n\u00e2b\u00e2d", "Khawst", "Kholm", "Lashkar G\u00e2h", "Mahm\u00fbd-e R\u00e2q\u00ee", "Mayd\u00e2nshahr", "Maym\u00e2nah", "Maz\u00e2r-e Shar\u00eef", "Mehtar L\u00e2m", "N\u00fbrist\u00e2n", "Pol-e Alam", "Pol-e Khumri", "Qal\u00b4eh-ye Naw", "Qal\u00e2t-e Ghilzay", "Qandah\u00e2r", "Qund\u00fbz", "Sar-e Pul", "Shibarghan", "T\u00e2loq\u00e2n", "Tar\u00een Kawt", "Zaranj", "Zareh Sharan"], "country": "Afganistan"}, {"code": "AL", "cities": ["Bajram Curri", "Ballsh", "Berat", "Bilisht", "Bulqiz\u00eb", "Burrel", "\u00c7orovod\u00eb", "Delvin\u00eb", "Durr\u00ebs", "Elbasan", "Ersek\u00eb", "Fier", "Gjirokast\u00ebr", "Gramsh", "Kavaj\u00eb", "Koplik", "Kor\u00e7\u00eb", "Kruj\u00eb", "Krum\u00eb", "Ku\u00e7ov\u00eb", "Kuk\u
@Yengas
Yengas / README.md
Last active April 4, 2025 08:30
Creating Table of Contents by reading the folder and file structure of a git project

toc.py

This script reads the structure of your git project to create a markdown table of contents. You can use the output of this script to add a TOC to the README of your project.

Example folder structure:

.
├── Test
│   └── README.md
├── Test2
│   ├── README.md
@Yengas
Yengas / f0rtig8.sh
Last active March 20, 2017 16:00
Trakya Üniversitesi Fortigate Authentication Otomatikleştirme. Kısaca: bash script ile internet bağlantısını aktif tutma. $USER kısmına mail adresinizin @'den öncesini, $PASSWORD kısmına şifrenizi girin.
#!/bin/bash
IP=10.40.254.2
PORT=1000
SLEEP_TIME=5
USER="USER"
PASSWORD="PASS"
# Color and info
RED='\033[0;31m'
GREEN='\033[0;32m'
CYAN='\033[0;36m'
@Yengas
Yengas / cqlsh-import-csv-gz.sh
Last active November 15, 2020 09:07
Cassandra CSV import with GZIP compression
(echo "COPY flat.data (metric, resource, domain, timestamp, longvalue, doublevalue, textvalue) FROM STDIN;"; \
gzip -dc flat-data-*.csv.gz;) | cqlsh
@Yengas
Yengas / videostab.py
Last active March 21, 2025 20:03
Video Stabilization with Python3.5 and OpenCV3 following chen jia's cpp implementation.
#!/usr/bin/python3.5
import sys
import argparse
import cv2
from math import atan2, cos, sin
import numpy as np
# this class is based on the code of Nghia Ho who first coded it for video files
# and the code of chen jia who added kalman filter for live features.
# see http://nghiaho.com/uploads/videostabKalman.cpp