Skip to content

Instantly share code, notes, and snippets.

View Chemaclass's full-sized avatar
🏗️
building

Jose M. Valera Reales Chemaclass

🏗️
building
View GitHub Profile
@bowsersenior
bowsersenior / stooge_loader.rb
Created May 18, 2011 23:18
A demo of YAML anchors, references and nested values
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {
@bvsatyaram
bvsatyaram / .gitconfig
Created December 20, 2011 05:10 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = [email protected]
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active November 30, 2025 00:48
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@honza
honza / gist.md
Created June 30, 2013 23:03
Clojure vs Haskell

Haskell vs Clojure

The JSON data is in the following format

{
    "Genesis": {
        "1": {
            "1": "In the beginning..." ,
            "2": "..."
$logger = new Logger('test logger');
$memoryStream = fopen('php://memory', 'w');
$memoryHandler = new StreamHandler($memoryStream);
$logger->pushHandler($memoryHandler);
// your code
rewind($memoryStream);
$logs = stream_get_contents($memoryStream);
@chregu
chregu / gist:9740519
Last active October 11, 2018 08:55
HHVM async example
<?hh
class Fetcher {
// async function: http://docs.hhvm.com/manual/en/hack.async.php
// return type annotation: http://docs.hhvm.com/manual/en/hack.annotations.introexample.php
// generics: http://docs.hhvm.com/manual/en/hack.generics.php
public async function fetch(string $url) : Awaitable<int> {
$ch1 = curl_init();
print "get $url \n";
@jordillonch
jordillonch / async_fetcher.php
Created March 29, 2014 22:42
HHVM async example using curl_multi_exec
<?hh
// Based on https://gist.github.com/chregu/9740519
class Fetcher {
// async function: http://docs.hhvm.com/manual/en/hack.async.php
// return type annotation: http://docs.hhvm.com/manual/en/hack.annotations.introexample.php
// generics: http://docs.hhvm.com/manual/en/hack.generics.php
public async function fetch(string $url) : Awaitable<array>
{
@brianlmoon
brianlmoon / current_on_object.php
Last active April 21, 2016 23:18
WTF PHP current() on object?
<?php
class Foo {
private $bar = "private variable 1";
private $bar2 = "private variable 2";
}
$foo = new Foo;
echo current($foo)."\n";

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@ygrenzinger
ygrenzinger / CleanArchitecture.md
Last active November 13, 2025 14:31
Summary of Clean Architecture by Robert C. Martin

Summary of book "Clean Architecture" by Robert C. Martin

Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software.

Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book.

Clean Architecture leaves me with the same feeling, even if it's pushing the development world to do better, has some good stories and present robust principles to build software.

The book is build around 34 chapters organised in chapters.