Skip to content

Instantly share code, notes, and snippets.

View ababushkin's full-sized avatar

Anton Babushkin ababushkin

View GitHub Profile
@ababushkin
ababushkin / gist:1221305
Created September 16, 2011 05:54 — forked from benjaminpearson/gist:1102194
Apps for a fresh Mac OS
1password - Password mangager
Adium - Instant messenger
Arq - Amazon s3 backup
Base - Sqlite db viewer
Caffeine - Keeps computer awake
Charles - Web debugging proxy
Cornerstone - SVN client
Cyberduck - FTP client
Delibar - Delicious bookmarking menu item
DiskWave - Monitor hdd space
@ababushkin
ababushkin / js-snippets-squiz-matrix.js
Created September 21, 2011 23:26
JavaScript Snippets for Squiz / MySource Matrix
/**
/**
* Changes the sort order of assets in Squiz Matrix
* Author: Nicholas Hubbard (http://www.zedsaid.com/blog/change-the-asset-map-sort-order-using-javascript-in-squiz-matrix)
*
* @param number id ID of the asset to move
* @param number parent ID of the parent that the asset is under
* @param number new_position New position of asset (0 is first in the sort order)
*
* @return string
@ababushkin
ababushkin / create-asset-squiz-matrix.php
Created September 21, 2011 23:36
PHP - Create an asset in Squiz / MySource Matrix
<?php
// First, include the Matrix bootstrap
// When ever a user makes any request to a Matrix page, this file is loaded (i.e. in the index.php file)
$SYSTEM_ROOT = "/home/websites/squiz_matrix/";
require_once $SYSTEM_ROOT . "core/include/init.inc";
// Now we need to log in
// The easiest user to work with is Root User
$root_user = $GLOBALS["SQ_SYSTEM"]->am->getSystemAsset("root_user");
@benjaminpearson
benjaminpearson / gist:1102194
Last active March 5, 2016 15:50
Apps for a fresh Mac OS
1password - Password mangager
3hub - Amazon s3 file manager
Adium - Instant messenger
Arq - Amazon s3 backup
Air Server - Send your iPhone/iPad screen to your mac screen for demos
Alfred - Launch bar app (must have)
Base - Sqlite db viewer
Caffeine - Keeps computer awake
Charles - Web debugging proxy
Cornerstone - SVN client
@dimo414
dimo414 / cat.py
Created June 26, 2012 04:54
Fast File Concatenation in Python
'''
Tests different methods of concatenating files in Python.
'''
from __future__ import print_function
import json,os,shutil,subprocess
import util
def verify(file,expected):
count = 0
@freeformz
freeformz / WhyILikeGo.md
Last active October 6, 2022 23:31
Why I Like Go

A slightly updated version of this doc is here on my website.

Why I Like Go

I visited with PagerDuty yesterday for a little Friday beer and pizza. While there I got started talking about Go. I was asked by Alex, their CEO, why I liked it. Several other people have asked me the same question recently, so I figured it was worth posting.

Goroutines

The first 1/2 of Go's concurrency story. Lightweight, concurrent function execution. You can spawn tons of these if needed and the Go runtime multiplexes them onto the configured number of CPUs/Threads as needed. They start with a super small stack that can grow (and shrink) via dynamic allocation (and freeing). They are as simple as go f(x), where f() is a function.

FROM ubuntu:16.04
RUN PACKAGES="\
php-cli \
php-mysql \
php-intl \
php-xml \
php-curl \
php-dom \
" && \
@briceburg
briceburg / Dockerfile.fails
Created March 30, 2016 22:17
docker - example adding www-data user to alpine images
FROM nginx:alpine
# stock verison from php:alpine image
# ensure www-data user exists
RUN set -x \
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data
# 82 is the standard uid/gid for "www-data" in Alpine
# http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2
@chadrien
chadrien / README.md
Last active September 1, 2023 12:43
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active September 23, 2023 09:38
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.