Skip to content

Instantly share code, notes, and snippets.

View stavrossk's full-sized avatar
🎯
Focusing

Stavros Skamagkis stavrossk

🎯
Focusing
View GitHub Profile
@stavrossk
stavrossk / File hash calculator.cs
Last active December 13, 2015 22:39
File hash calculator
private static byte[]
ComputeFileHash
(string filename)
{
try
{
Stream input
= File.OpenRead
@stavrossk
stavrossk / OSdb interface.cs
Created February 19, 2013 13:12
OpenSubtitles.org XMLRPC interface
using CookComputing.XmlRpc;
// ReSharper disable CheckNamespace
namespace VideoSubtitleDownloader
// ReSharper restore CheckNamespace
{
@stavrossk
stavrossk / OSdb login operations.cs
Created February 19, 2013 13:26
OpenSubtitles.org login operations
public class OSdbLoginOperations
{
private const string TxtUrl
= "http://api.opensubtitles.org/xml-rpc";
internal static IOpenSubtitlesRemoteFunctions Proxy;
public static string Token
@stavrossk
stavrossk / README.md
Created February 19, 2013 21:22 — forked from jaydson/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
#include<stdio.h>
#include<stdlib.h>
#include<netdb.h>
#include<arpa/inet.h>
int main(int argc, char **argv) {
struct hostent *host;
char str[100];
char addr[INET_ADDRSTRLEN];
@stavrossk
stavrossk / Debugger.cs
Created February 19, 2013 21:42
Debug logger: Write debug message to log file.
public class Debugger
{
public static void LogMessageToFile(string msg)
{
if ( !Settings.WriteDebugLog)
return;
@stavrossk
stavrossk / tv episode file metadata extraction regex
Created February 20, 2013 08:49
Regural expressions for extracting key metadata from tv episode media files. This metada will be used by entertainment media application for online media identification.
@".*[s,S](?<SeasonNumber>\d{1,2}).?[e,E](?<EpisodeNumber>\d{1,2}).*"
@"(.*\\)*(?<SeriesName>.*)((s|S)(?<SeasonNumber>[0-9]{1,2})(e|E)(?<EpisodeNumber>[0-9]{1,2}))(.(?<Name>.*)|.*)\.(?<FileType>...?)"
CL-USER> (test-steinhart-hart)
Steinhart-hart coefficients for the ACI/10K-CP curve are:
A: 0.0011212672
B: 2.3534849E-4
C: 8.3802405E-8
Resistance: 336450.0 Expected: -40.0 Calculated: -39.999985
Resistance: 242660.0 Expected: -35.0 Calculated: -35.009888
Resistance: 176960.0 Expected: -30.0 Calculated: -30.018707
Resistance: 130410.0 Expected: -25.0 Calculated: -25.02591
@stavrossk
stavrossk / SDL: Drawing text sample function.c
Last active July 12, 2021 22:13
SDL Tutorial: Drawing Text with SDL.
// TTF_Init() must be called before using this function.
// Remember to call TTF_Quit() when done.
void drawText
(SDL_Surface* screen, char* string,
int size, int x, int y,
int fR, int fG, int fB,
int bR, int bG, int bB)
{