Skip to content

Instantly share code, notes, and snippets.

@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');
'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 / 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(){
@Yengas
Yengas / say_number.c
Created January 2, 2016 14:36
Integer to Turkish Text Representation
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
const char* postnames[7] = {"Yüz", "Bin", "Milyon", "Milyar"};
const char* prenames[2][9] = {{"Bir", "İki", "Üç", "Dört", "Beş", "Altı", "Yedi", "Sekiz", "Dokuz"},
{"On", "Yirmi", "Otuz", "Kırk", "Elli", "Atmış", "Yetmiş", "Seksen", "Doksan"}};
typedef struct _NODE{
const char* text;
@Yengas
Yengas / client.go
Created December 19, 2015 19:19
Twitter stream client with raw TLS socket
package client
import (
"bufio"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"net/http/httputil"
"net/url"
@Yengas
Yengas / application.properties
Last active December 18, 2015 02:01
Change youtube videos privacy setting between given times with whitelisting/blacklisting of videos
{
"whitelist": [],
"blacklist": [],
"tcom": [[225, "public"], [230, "private"]],
"account": {
"client_id": "xxx",
"client_secret": "xxx",
"refresh_token": "xxx"
}
}
@Yengas
Yengas / DropdownLoader.js
Last active November 14, 2015 09:56
Populating a dropdown list with an ajax request.
function DropdownLoader(options) {
var options = options,
loading = false,
completed = false;
var obj = document.querySelector(options.selector);
function load() {
loading = true;
var xml = new XMLHttpRequest();
xml.open("GET", options.url, true);
@Yengas
Yengas / WordSolver.java
Last active August 29, 2015 14:22
Boggle Solver
package rec.probs;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Locale;
public class WordSolver {
public class Piece{
@Yengas
Yengas / SHA.cpp
Created June 1, 2015 14:33
SHA-1 Hash Function Implementation
#include "SHA.h"
#include <cmath>
#include <iostream>
#include <iomanip>
uint32_t stageOneFunction(uint32_t b, uint32_t c, uint32_t d) {
return (b & c) | ((~b) & d);
}
uint32_t stageTwoFunction(uint32_t b, uint32_t c, uint32_t d) {
return b ^ c ^ d;
@Yengas
Yengas / TextToSpeech.txt
Last active March 5, 2021 00:55
Text to Speech
Reverse engineered flash application @ http://www.oddcast.com/home/demos/tts/tts_example.php
1 = name string
2 = voice int
3 = lang int
4 = engine int
5 = fx_type string
6 = fx_level int
<engineID>{engine}</engineID><voiceID>{voice}</voiceID><langID>{lang}</langID><ext>mp3</ext>