Skip to content

Instantly share code, notes, and snippets.

View brendomaciel's full-sized avatar

Brendo Maciel brendomaciel

  • Else Consultoria
  • Brazil
View GitHub Profile
@ThePredators
ThePredators / readme-mde.md
Last active April 9, 2024 21:43
Setup Mobile Development Environment

⭐ Setup Mobile Development Environment

⚠️ The following configuration has been tested on Intel, M1 & M2 Ships ⚠️

Pre-requisit :

If you have any issues with macOS, or need anything related to it check this documentation

Install Xcode Command Line tools :

@arvindpdmn
arvindpdmn / JS.Done.Right.md
Last active February 16, 2023 20:05
JavaScript Done Right! (Basics, Functions, Inheritance, Async)

JavaScript Done Right!
Devopedia, Sept 2018

0. Introduction

JavaScript is one of the top programming languages today. It can also be confusing for developers coming from C, Java or PHP backgrounds. Worse still are the numerous frameworks (such as Angular and React) that make it difficult to decide what to learn and how to use the language.

In this short talk/demo, we'll look at the best practices in JavaScript programming. We'll explain using simple examples. This is for beginners and intermediate JS programmers. You must be familiar with JS syntax. We'll not cover DOM access, jQuery, Node.js or JS frameworks.

The recommendations here assume that you use a transpiler such as Babel so that code can work on older browsers. Therefore we freely use syntax from recent ECMAScript standards.

@jeffochoa
jeffochoa / Response.php
Last active May 4, 2024 08:50
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@slav123
slav123 / replace.php
Created January 25, 2016 04:11
replace select ... part from mysql query with count
<?php
/**
* replace select in query
*
* @param string $query query to replace
* @param string $pkey primary key
*
* @return mixed|string
*/
function count_row($query, $pkey) {
@mindplay-dk
mindplay-dk / session-life-cycle.md
Last active March 28, 2024 19:52
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().

@eddmann
eddmann / SecureSessionHandler.php
Created April 9, 2014 12:18
Secure session handler implementation.
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;