Skip to content

Instantly share code, notes, and snippets.

View Majkl578's full-sized avatar
💥
breaking builds

Michael Moravec Majkl578

💥
breaking builds
View GitHub Profile
@jrburke
jrburke / build.js
Created December 22, 2011 05:58
Doing multiple almond builds with a nodejs script, example
//Download jquery.js and place it in the build, do not use require-jquery.js
//in the build, since each of the build layers just needs almond and not the
//full require.js file.
//This file is run in nodejs to do the build: node build.js
//Load the requirejs optimizer
var requirejs = require('./r.js');
//Set up basic config, include config that is
//common to all the requirejs.optimize() calls.
@beberlei
beberlei / README.md
Created February 8, 2012 08:25
Collection Filters - Readme Driven Development

Filter Language for Collections

Why?

You often need subsets of objects in a collection and want to access them efficiently in your domain model. But you certainly don't want to access the EntityManager or any other object manager here to craft a query. FilterExpressions for collections allow to go back to the database and query for all objects matching the crafted expression. Additionally they also work against in meemory ArrayCollection exactly the same. This way you don't (except for the SQL performance when it haunts you ;)) have to think about the context and can focus on your domain logic.

In Doctrine ORM this will be done by building DQL under the hood, in memory it will be done using Collection#filter(Closure $closure);

Technical Requirements:

@fprochazka
fprochazka / fastcgi.conf
Last active April 10, 2020 03:07
nginx config files
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
@fprochazka
fprochazka / Admin.BasePresenter.php
Created March 14, 2012 14:28
Security annotace nad presentery v #nettefw
<?php
namespace AdminModule;
use Nette;
/**
*/
@hrach
hrach / .bashrc
Last active October 12, 2016 12:07
Git config
alias gui='git gui&'
alias gitk='gitk --all &'
source /c/dev/git-bash-tools/completion.bash # find it in your git installation path
hg_ps1() {
hg prompt "{ {branch}}{ at {bookmark}}{{status}}" 2> /dev/null
}
function color_my_prompt {
@JanTvrdik
JanTvrdik / add_pull_request_to_issue_github.sh
Last active June 6, 2016 19:25
Add pull request to existing issue on github
#!/bin/bash
current_branch="$(git symbolic-ref HEAD 2>/dev/null)" || current_branch="(unknown)"
current_branch=${current_branch##refs/heads/}
github_username="JanTvrdik"
github_token="..."
if [[ $current_branch = "(unknown)" ]]
then
@mishak87
mishak87 / FacebookPresenter.php
Created May 5, 2012 17:31
Fix for facebook was not playing along with nette sessions
<?php
namespace UserModule;
use FixFacebook;
class FacebookPresenter extends AbstractSignPresenter
{
public function actionLogin()
@ondrejmirtes
ondrejmirtes / in_array.php
Created May 24, 2012 10:47
PHP WTFs - in_array()
<?php
$keys = array(
'scheme',
'user',
'pass',
'host',
'port',
'path',
'query',
@jboner
jboner / latency.txt
Last active May 10, 2025 11:02
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@vojtech-dobes
vojtech-dobes / add_pull_request_to_issue_github.sh
Created June 22, 2012 12:29 — forked from JanTvrdik/add_pull_request_to_issue_github.sh
Add pull request to existing issue on github
#!/bin/bash
current_branch="$(git symbolic-ref HEAD 2>/dev/null)" || current_branch="(unknown)"
current_branch=${current_branch##refs/heads/}
if [[ $current_branch = "(unknown)" ]]
then
echo "Unable to determine current branch!"
exit 1
fi