Skip to content

Instantly share code, notes, and snippets.

@Yengas
Yengas / RubyGCMSend.rb
Last active August 29, 2015 13:57
Example of GCM HTTP send in Ruby
#encoding: utf-8
require 'net/http'
require 'json'
require 'openssl'
GOOGLE_API_KEY = "xxxxx";
GOOGLE_PROJECT_NUMBER = "xxxx";
data = { 'message' => 'Deneme' };
to = ["put", "keys", "in", "this", "array"];
@Yengas
Yengas / ListOptions.js
Last active August 29, 2015 13:57
TeknoBiyotik Pc Sihirbazı, fiyata göre listeleme
function listOptions(id){
var select = document.getElementById(id), options = select.getElementsByTagName("option");
var i, node, objects = {}, keys, match;
for(i = 0; i < options.length; i++){
node = options[i];
if(node == null || node == undefined || (match = node.innerText.match(/([\d]+,[\d]+) TL/)) == null){ continue; }
objects[parseInt(match[1])] = node;
}
@Yengas
Yengas / Kissanime.js
Last active April 5, 2022 01:23
Continous watching, Localstorage features(Where you left an episode), Downloading and Streaming functionality to Kissanime
// ==/UserScript==
// ==UserScript==
// @name Premium Kissanime
// @version 0.5
// @description Tampermonkey script for better kissanime usage.
// @include /https?://(www\.|)kissanime\.(to|org|me|com)/*/
// @copyright 2012+, Yengas
// ==/UserScript==
// Disable Adblock Detection
@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>
@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 / 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 / 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 / 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 / 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 / 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;