Skip to content

Instantly share code, notes, and snippets.

View zetta's full-sized avatar
:octocat:
Coding for change

Carlos Clemente zetta

:octocat:
Coding for change
View GitHub Profile
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 24, 2024 14:17
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@zetta
zetta / CV.md
Last active January 23, 2022 07:37
Curriculum

Carlos Clemente

Summary

  • Detail oriented, high experienced software engineer with 18+ years of experience in a variety of mission critical environments.
  • Solid hands on skills in troubleshooting and resolving complex hardware, software and data issues.
  • Systems Automation, Performance tuning and monitoring.
  • High capacity to absorb new workflows and technologies.
  • Solid work experience of leading cross functional and multiple projects simultaneously from planning to completion and ensuring delivery of the project in time with high customer satisfaction.
anonymous
anonymous / my.cnf
Created August 12, 2014 20:54
# Example MySQL config file for very large systems.
#
# This is for a large system with memory of 1G-2G where the system runs mainly
# MySQL.
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
@zetta
zetta / renamer.php
Last active August 29, 2015 14:01
<?php
$oldName = get_argument(1, 'You must specify the current database name', true);
$newName = get_argument(2, 'You must specify the new database name', true);
try
{
echo 'Database renamer 1.0', "\n\n";
echo "Renaming database ${oldName} to ${newName}\n";
echo 'Connecting to mysql...', "\n";
@krakjoe
krakjoe / pool.md
Last active January 30, 2020 12:33
Pooling

Easy pthreads Pools

The final solution !!

Since the first version of pthreads, PHP has had the ability to initialize Worker threads for users. Onto those Worker threads are stacked objects of class Stackable for execution concurrently.

The objects stacked onto workers do not have their reference counts changed, pthreads forces the user to maintain the reference counts in userland, for the extremely good reason that this enables the programmer to keep control of memory usage; and so, execute indefinitely.

This is the cause of much heartache for newcomers to pthreads; if you do not maintain references properly you will, definitely, experience segmentation faults.

@nikic
nikic / objects_arrays.md
Last active April 12, 2024 17:05
Post explaining why objects often use less memory than arrays (in PHP)

Why objects (usually) use less memory than arrays in PHP

This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)

The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?

The key here is that objects usually have a predefined set of keys, whereas arrays don't:

@danvbe
danvbe / 1-Explanations.md
Last active April 21, 2023 15:39
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.