Skip to content

Instantly share code, notes, and snippets.

View DailyMatters's full-sized avatar
🎯
Focusing

Cláudio Ribeiro DailyMatters

🎯
Focusing
  • Lisbon
View GitHub Profile
# split panes using | and -
bind | split-window -h
bind - split-window -v
# change status bar colors
set -g status-bg colour74
set -g status-fg white
# change the active pane colors
set -g pane-active-border-bg colour74
" " Be sure to have both curl and git installed on the machine.If you don't
" " plugins will NOT be installed and notices will be shown ;)
set nocompatible
filetype plugin on
set number
set hlsearch
set incsearch
syntax enable
Function Description
array_change_key_case( array $array [, int $case = CASE_LOWER ] ) Changes the case of all keys in an array.
array_chunk( array $array , int $size [, bool $preserve_keys = false ] ) Split an array into chunks.
array_column( array $input , mixed $column_key [, mixed $index_key = null ] ) Return the values from a single column in the input array.
array_combine( array $keys , array $values ) Creates an array by using one array for keys and another for its values.
array_count_values( array $array ) Counts all the values of an array.
array_diff_assoc( array $array1 , array $array2 [, array $... ] ) Computes the difference of arrays with additional index check.
array_diff_key( array $array1 , array $array2 [, array $... ] ) Computes the difference of arrays using keys for comparison.
array_diff_uassoc( array $array1 , array $array2 [, array $... ], callable $key_compare_func ) Computes the
@DailyMatters
DailyMatters / dbtest.php
Created January 17, 2017 15:59
Testing sqlite databases on PHP script
<?php //origin: http://www.if-not-true-then-false.com/2012/php-pdo-sqlite3-example/
const SQLITE3_TEXT = PDO::PARAM_STR;
const SQLITE3_INTEGER = PDO::PARAM_INT;
// Set default timezone
date_default_timezone_set('UTC');
try {
/**************************************
@DailyMatters
DailyMatters / index.php
Created September 19, 2016 21:18
Raw index for AtlasORM
<?php
namespace Atlas\DataSource\Users;
use App\DataSource\Users\UsersMapper;
use Atlas\Orm\Mapper\Mapper;
require_once __DIR__ . '/vendor/autoload.php';
$atlasContainer = new AtlasContainer('mysql:host=localhost;dbname=users','root', '' );
@DailyMatters
DailyMatters / composer.json
Created September 19, 2016 21:12
Composer for AtlasORM
{
"require": {
"atlas/orm": "@dev"
},
"require-dev": {
"atlas/cli": "@dev"
},
"autoload": {
"psr-4": {
"App\\DataSource\\Users\\": "src/"
@DailyMatters
DailyMatters / SundayMVC.php
Created December 7, 2015 16:07
SundayMVC Bitches!
<?php
/*****************************************************************
Copyright (c) 2015
Cláudio Ribeiro <claudio.santos.ribeiro@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
@DailyMatters
DailyMatters / pre-commit
Created December 2, 2015 12:10
Pre-Commit Hook for git - Shows the status of the repository on commit
#!/usr/bin/env bash
files = $(git status --short)
echo -e " \e[35m Changed Files: \e[0m "
for file in $files; do
echo -e file
done
@DailyMatters
DailyMatters / GitCheat.txt
Last active October 5, 2024 14:52
Git cheat sheet (Portuguese)
Glossário:
Repository: A directory where Git has been initialized to start version controlling your files.
Staged: Files are ready to be committed.
Unstaged: Files with changes that have not been prepared to be committed.
Untracked: Files aren't tracked by Git yet. This usually indicates a newly created file.
Deleted: File has been deleted and is waiting to be removed from Git.
Staging Area: A place where we can group files together before we "commit" them to Git.
Commit: A "commit" is a snapshot of our repository. This way if we ever need to look back at the changes we've made (or if someone else does), we will see a nice timeline of all changes.
HEAD: The HEAD is a pointer that holds your position within all your different commits. By default HEAD points to your most recent commit, so it can be used as a quick way to reference that commit without having to look up the SHA.
@DailyMatters
DailyMatters / Vagrantfile
Last active December 2, 2015 11:50
Vagrant file for simple Ubuntu VM
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at