Skip to content

Instantly share code, notes, and snippets.

View maciejczyzewski's full-sized avatar

Maciej A. Czyzewski maciejczyzewski

View GitHub Profile
@Thinkscape
Thinkscape / PSR-0-final-proposal.md
Created September 22, 2011 10:30
PSR-0 Final Proposal (PHP Standards Working Group)

PSR-0 Final Proposal (PHP Standards Working Group)

The following describes the mandatory requirements that must be adhered to for autoloader interoperability.

Mandatory:

  • A fully-qualified namespace and class must have the following structure \ <Vendor Name> \ (<Namespace>)* \ <Class Name>
  • Each namespace must have a top-level namespace ("Vendor Name").
  • Each namespace can have as many sub-namespaces as it wishes.
  • Each namespace separator is converted to a DIRECTORY_SEPARATOR when loading from the file system.
  • Each "_" character in the CLASS NAME is converted to a DIRECTORY_SEPARATOR. The "_" character has no special meaning in the namespace.
@donatj
donatj / ColorCLI.php
Created October 26, 2011 03:34
Simple CLI color class
<?php
class ColorCLI {
static $foreground_colors = array(
'bold' => '1', 'dim' => '2',
'black' => '0;30', 'dark_gray' => '1;30',
'blue' => '0;34', 'light_blue' => '1;34',
'green' => '0;32', 'light_green' => '1;32',
'cyan' => '0;36', 'light_cyan' => '1;36',
@javan
javan / sl2-setup.md
Created July 23, 2012 14:47
My Sublime Text 2 setup
@anchetaWern
anchetaWern / laravel-ums.markdown
Created December 6, 2012 11:14
Building a User Management System in Laravel

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@agasiev
agasiev / KMP_prefix.cpp
Created December 6, 2012 23:24
KMP prefix function
std::vector<unsigned> kmp_prefix_function(std::string s) {
size_t n = s.size();
std::vector<unsigned> result(n);
for (int i = 1; i < n; i++) {
int j = result[i-1];
while (j > 0 && s[i] != s[j])
j = result[j-1];
@ws6
ws6 / kmp.cpp
Created January 10, 2013 06:10
a fabulous KMP tutorial
//http://dev-faqs.blogspot.com/2010/05/knuth-morris-pratt-algorithm.html
#include "PatternMatcher.h"
vector<int> PatternMatcher::computeKmpPrefix(const std::string &pattern){
int patternSize = pattern.size();
vector<int> kmpPrefix(patternSize);
size_t prefixPos = 0;
size_t suffixPos = 1;
while(suffixPos < patternSize){
@epson121
epson121 / bs_tree_size.cpp
Created February 23, 2013 10:49
BS-tree size solved with and without additional memory.
/*
* BS-tree size solved with and without additional memory.
*
*/
#include <iostream>
#include <cstdlib>
using namespace std;
<?php
/**************DO NOT MODIFY ANYTHING PAST THIS POINT*************/
eval(base64_decode("JF9fRklMRV9fPV9fRklMRV9fOyRfWD0nTSNpb0NHbk5ucSshRC83QWIyCnFwIW8wPDYzdE9sa0wxdG9vbCtQdDJNOGtNeUlFCUxEeDcmdjY+aDtxaFBvPi9NT3NIZGVleDwjdjwyMCM+NEJpJD9ldDM2ejxjZkVmejBNCWpqQ2c0S2dGOHd0NWp4CW12NTIhS2JJS3NIc2skaXBrQmpIQThjdXkzOTJnM3hlZ3R2TCZFMTdudmcjUDQKSSM4YzVNd3RlI04vdmp3SDJ1TGY1cgk0clB6CWQydDYwSDBuc29nQms0Z3chOGQ/KyNDMU0JZHoJPHBIY0VJRjA7d3I5NkRzZQl1RzlCbz9JbjFkdjhzCj5paHJLQ2Uzd3o3TkhLPEw4NAp2ZglnSHV2OT5sP1AjCkY8YzRLTEFnc0g/I2QxSHBkdWYKNiRHQXVpNDBwdzgJPzNxdUt6OTAyazJlMUpoJmsJaGZNPmJMRzF4diZnTysrN1BIJmhhK3RtYjVIMko5TUdjMjw4Q1BqdUw2Tkk0eWQ/c3RHJnRiZwp0T2czJAlDTDQkYmw/SjAmYzM0Rm9uQmRoeDcyNXlycCZkeGhoJjFKP2k5cyZyUGN3ZgliZXY/az8hcWFiRXU5YXo2R3l1dVA0RiNueW5KbkIyaCs1akoJL2UkOXpDTiR1OGdhO3pKJDdFck5CbWo/Q2IJOzxCZTZybWphQ3kreUROb05taDNqaWZGb2M2d28zbThQZzYyakpleDQwOUp6cHIhKzdkCgp3aEVDQTQ4ampCT3M+JmJxZCRzeCtkMXdQSC9DMXNmPjcmaStqdzVtd08jMm9GaiZDY3I0CTVvPnhEczw0IXozMXBNeG0xYUI0IWpzMj8xczk7RFBoZiEKaTYrck5kbkVkaiRjciM7PFBmM20KR1AyNSQ/Tk
@jo
jo / js-crypto-libraries.md
Last active July 11, 2024 17:44
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@booch
booch / Ruby ORMs.md
Created February 10, 2014 22:19
Ruby ORMs

Ruby ORMs

Abstract

Rails is really a collection of pieces that can be put together to create a web app. You can enhance or replace many of the components - how you write views, how controllers work, and how you build models. While models are built on top of ActiveRecord in the