Skip to content

Instantly share code, notes, and snippets.

View kalimatas's full-sized avatar

Alexander Guz kalimatas

View GitHub Profile
@kalimatas
kalimatas / PushVsMerge.php
Last active May 26, 2020 13:02
PHPBench array_push vs array_merge
<?php
declare(strict_types = 1);
use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods;
use PhpBench\Benchmark\Metadata\Annotations\Revs;
require 'vendor/autoload.php';
/**
@kalimatas
kalimatas / array_nested_create.php
Created August 13, 2016 18:57
Nested array creation
<?php
$taxes = [
[
'country_id' => 'a',
'value' => 42,
'type' => 't1',
],
[
'country_id' => 'a',
@kalimatas
kalimatas / csa.php
Last active May 19, 2016 16:01
CSA prototype, one-to-one
<?php
$stops = [
1 => 'A',
2 => 'B',
3 => 'C',
4 => 'D',
5 => 'E',
6 => 'F',
7 => 'H',
@kalimatas
kalimatas / gist:216cd609604993824e00
Last active August 29, 2015 14:14
Struct size in C
#include <stdio.h>
#include <limits.h>
typedef struct _zval_struct zval;
typedef struct _zend_object {
int *ce;
int *properties;
zval **properties_table;
int *guards;
@kalimatas
kalimatas / gist:10470673
Last active August 29, 2015 13:59
Issues template
<!DOCTYPE html>
<html>
<head>
<style>
* {
font-family: Arial, sans-serif;
}
.issue {
text-align: left;
width: 700px;
@kalimatas
kalimatas / ip32convert.go
Last active August 29, 2015 13:56
Convert 32 bitwise IP representation to string
package main
import (
"fmt"
"math"
"strconv"
"strings"
)
func main() {
@kalimatas
kalimatas / about.md
Created August 16, 2011 12:06 — forked from blaix/about.md
Programming Achievements: How to Level Up as a Developer

Programming Achievements: How to Level Up as a Developer

  1. Select a particular experience to pursue.
  2. Pursue that experience to completion. (Achievement unlocked!)
  3. Reflect on that experience. Really soak it in. Maybe a blog post would be in order?
  4. Return to Step 1, this time selecting a new experience.

This gist is a fork of the gist from this blog post.

@kalimatas
kalimatas / about.md
Created August 16, 2011 12:01 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer