Skip to content

Instantly share code, notes, and snippets.

View philipproplesch's full-sized avatar
🏠
Working from home

Philip Proplesch philipproplesch

🏠
Working from home
View GitHub Profile
@yadyn
yadyn / SemanticVersion.cs
Created May 6, 2011 18:11
Semantic Version C# class
using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Represents assembly, application, or other version information,
/// compliant with the Semantic Versioning specifications.
/// </summary>
/// <remarks>
/// See http://semver.org/ for specifications.
@ffdead
ffdead / if-resolution.scss
Created December 5, 2012 12:32
SASS resolution media query mixin
/* @author 14islands.com
* SASS mixins for future proof resolution media query
*/
@mixin if-min-resolution($dppx) {
@include if-resolution(min, $dppx) {
@content;
}
}
@echo off
if %1.==. goto :usage
rem Pass second parameter to override subdir in Dropbox folder.
if %2.==. (
set SUBDIR=%~n1
) else (
set SUBDIR=%~2
)
_REST_, or Representational State Transfer is probably one of the most misunderstood terms in Web API development today. Where REST is misunderstood is that most people use REST as synonymous with anything that is easy to access over HTTP and forget about the constraints completely.
The term's roots are from Roy Fielding's previously mentioned dissertation on network based architecture (http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm). In it, Roy describes REST as an architectural style for distributed hypermedia systems. What he is saying is that REST is not a technology, it is not a framework, and it is not a design pattern. It is a style. There is no "One True Way" to do REST and as a result, many flavours of RESTful systems. What they have in common however, and most importantly, is that RESTful systems manifest iteself in a set of constraints, which will be mentioned in more depth in this section.
The other part of the misunderstanding is that you MUST build a RESTful system. T
@iamsilvio
iamsilvio / commit-msg
Created July 10, 2013 10:19
git commit-msg hook to reject bad formated messages
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
def checkMessage(msg):
"""
Checks if the message content matches one of the message rules
B: <message>
@aruss
aruss / tourl.js
Last active December 19, 2015 18:29
Generate URI with path and query http://jsfiddle.net/aruss/wfCLT/1/
if (!String.prototype.toUrl) {
String.prototype.toUrl = function(o) {
var r = this.replace(/\{([^{}]*)\}/g,function (a, b) {
var r = o[b];
delete o[b];
return typeof r === 'string' || typeof r === 'number' ? r : a;
}
), p = [];
@davatron5000
davatron5000 / Sublime Text Setup.md
Last active April 15, 2023 15:39
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

@msmuenchen
msmuenchen / gist:9318327
Last active September 18, 2022 21:53
KeePass v2.x (KDBX v3.x) file format
Convention: Byte array notation as it would appear in a hexeditor.
= Layout=
KDBX files, the keepass database files, are layout as follows:
1) Bytes 0-3: Primary identifier, common across all kdbx versions:
private static $sigByte1=[0x03,0xD9,0xA2,0x9A];
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1)
@davidfowl
davidfowl / dotnetlayout.md
Last active May 23, 2024 10:58
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@lodejard
lodejard / go.sh
Last active August 29, 2015 14:08
libuv builder
wget http://dist.libuv.org/dist/v1.4.2/libuv-v1.4.2.tar.gz
tar -xvf libuv-v1.4.2.tar.gz
cd libuv-v1.4.2/
./gyp_uv.py -f make -Duv_library=shared_library
make -C out
sudo cp out/Debug/lib.target/libuv.so /usr/lib/libuv.so.1.4.2
sudo ln -sf libuv.so.1.4.2 /usr/lib/libuv.so.1