This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @yasinkuyu | |
// 27/04/2014 | |
public static float Sift3(string s1, string s2, int maxOffset) | |
{ | |
if (string.IsNullOrEmpty(s1)) | |
return ((string.IsNullOrEmpty(s2)) ? 0 : s2.Length); | |
if (string.IsNullOrEmpty(s2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @yasinkuyu | |
// 27/04/2014 | |
public static double Distance(double lat1, double lon1, double lat2, double lon2, char unit) | |
{ | |
Func<double, double> deg2Rad = (x) => (x * (Math.PI / 180)); | |
Func<double, double> rad2Deg = (x) => (x / Math.PI * 180.0); | |
var theta = lon1 - lon2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @yasinkuyu | |
// 06/05/2014 | |
public dynamic get_mem() | |
{ | |
dynamic returndata = new ExpandoObject(); | |
var search = new ManagementObjectSearcher("root\\CIMV2", "Select TotalVisibleMemorySize, FreePhysicalMemory from Win32_OPeratingSystem"); | |
foreach (var x in search.Get()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @yasinkuyu | |
# 15/05/2014 | |
import json | |
import MySQLdb | |
# First dump foursquare-categories.json ----> https://gist.github.com/janosgyerik/2906942 | |
# CREATE TABLE `category` ( | |
# `CatId` int(11) NOT NULL AUTO_INCREMENT, | |
# `ParentId` int(11) DEFAULT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @yasinkuyu | |
// 15/05/2014 | |
using System; | |
using System.IO; | |
using MySql.Data.MySqlClient; | |
using Newtonsoft.Json.Linq; | |
namespace FoursquareCategories | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @yasinkuyu | |
// 15/05/2014 | |
string code = ""; | |
string name = ""; | |
foreach (CultureInfo lang in CultureInfo.GetCultures(CultureTypes.AllCultures)) | |
{ | |
try | |
{ | |
code = CultureInfo.CreateSpecificCulture(lang.Name).Name.Replace("-", "_"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@ CSS/HTML/JS Units of Measure Parsing | |
@ Regular Expressions (RegEx / RegExp) Pattern | |
@ Test http://www.regexr.com/39424 | |
@ Pattern RegExp(/(\d*\.?\d+)\s?(px|em|ex|%|in|cm|mm|pt|pc+)/igm) | |
Yasin Kuyu - twitter.com/yasinkuyu */ | |
#Comments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "UTF-8"; | |
/** | |
* | |
* prism.js Okaidia dark for JavaScript, CSS and HTML | |
* @author Yasin Kuyu | |
* http://code.insya.com | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @yasinkuyu | |
// https://tr.wikipedia.org/wiki/T%C3%BCrk_alfabesindeki_harflerin_kullan%C4%B1m_s%C4%B1kl%C4%B1klar%C4%B1 | |
// Türk alfabesindeki harflerin kullanım sıklıkları | |
var alfabe = { | |
'A': 11.92, | |
'B': 2.844, | |
'C': 0.963, | |
'Ç': 1.156, | |
'D': 4.706, | |
'E': 8.912, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Türkçe sıra sayıları / Ordinal Numbers | |
for (var i = 1; i < 32; i++) { | |
if (i == 2) { var suffix = "nci"; } | |
else if (i == 3 || i == 4 || i == 13 || i == 14 || i == 23 || i == 24) { var suffix = "üncü"; } | |
else if (i == 6 ) { var suffix = "ncı"; } | |
else if (i == 9 || i == 10 || i == 19 || i == 29 || i == 39) { var suffix = "uncu"; } | |
else { var suffix = "inci"; } | |
console.log( i + '\'' + suffix); |
OlderNewer