Skip to content

Instantly share code, notes, and snippets.

View stavrossk's full-sized avatar
🎯
Focusing

Stavros Skamagkis stavrossk

🎯
Focusing
View GitHub Profile
@daocren
daocren / Html FrameWork Compare.md
Created March 22, 2013 11:00
Html FrameWork Compare
@stavrossk
stavrossk / PublicPatternCatalog.xml
Created February 28, 2013 01:58
JetBrains ReSharper: Sample pattern catalog for Structural Search and Replace.
<CustomPatterns>
<Pattern Severity="SUGGESTION">
<Comment>Method StringBuilder.Append can be converted to StringBuilder.AppendFormat</Comment>
<ReplaceComment>Convert to StringBuilder.AppendFormat</ReplaceComment>
<ReplacePattern>$sb$.AppendFormat($args$)</ReplacePattern>
<SearchPattern>$sb$.Append(string.Format($args$))</SearchPattern>
<Params />
<Placeholders>
<ExpressionPlaceholder Name="sb" ExpressionType="System.Text.StringBuilder" ExactType="True" />
<ArgumentPlaceholder Name="args" Minimal="-1" Maximal="-1" />
@stavrossk
stavrossk / Windows Shortcut Resolver.cs
Created February 26, 2013 01:25
Code to resolve Windows .lnk shortcuts and obtain the file path they refer to. Uses shfolder.dll.
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace WindowsGameMetadataRetriever
{
[Flags()]
enum SlgpFlags
{
/// <summary>Retrieves the standard short (8.3 format) file name</summary>
public static String findCommonPrefix(List<String> strings)
{
if (strings.size() == 0)
return "";
String prefix = strings.get(0);
for (int i = 1, s = strings.size(); s > i; i++)
{
String str = strings.get(i);
for (int j = 0, l = Math.min(prefix.length(), str.length()); l > j; j++)
@machinamentum
machinamentum / print_j.asm
Last active December 14, 2015 02:09
This is the simplest, smallest program to print a letter to the display. It was written in response to zhuowei's "i" program at https://github.com/zhuowei/i Unfortunately, due to the fact that this must be run as a boot sector, it must be bloated to 512 bytes. However, it takes up only 5 bytes of data itself, requires no bloated Operating System…
mov ax, 0x0E6A
int 0x10
times 510-($-$$) db 0
db 0x55 ; required for some BIOS's
db 0xAA
@stavrossk
stavrossk / Git Aliases.txt
Last active December 14, 2015 01:48 — forked from jasonrudolph/git-aliases
Git Aliases.
# git
alias gl='git pull'
alias gp='git push'
alias gd='git diff | mate'
alias gdh='git diff HEAD | mate'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gcap='git commit -v -a && git push'
alias gb='git branch'
alias gba='git branch -a'
@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)
{
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
@mohiji
mohiji / steinhart-test-results.txt
Last active December 13, 2015 23:29
Deriving Steinhart-Hart (http://en.wikipedia.org/wiki/Steinhart–Hart_equation) coefficients given a known thermistor response curve.
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