Skip to content

Instantly share code, notes, and snippets.

View pbrilius's full-sized avatar
🏠
Working from home

Povilas Brilius pbrilius

🏠
Working from home
View GitHub Profile
@jjulian
jjulian / example.erb
Created February 18, 2012 16:44
Running Ruby under Apache like PHP, using cgi - http://stackoverflow.com/a/1901772/231245
<% header "Content-Type" => "text/html" %>
<h1>Let's run some ruby code: <%= rand %></h1>

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@colinmollenhour
colinmollenhour / cleanCache.php
Created May 17, 2012 00:50
Simplified cache cleaning script for production updates.
<?php
/**
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml and
* then use this script to apply updates and refresh the config cache without
* causing a stampede on the config cache.
*
* @author Colin Mollenhour
*/
umask(0);
ini_set('memory_limit','512M');
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@andrewlkho
andrewlkho / gist:7373190
Last active March 25, 2024 03:37
How to use authentication subkeys in gpg for SSH public key authentication

GPG subkeys marked with the "authenticate" capability can be used for public key authentication with SSH. This is done using gpg-agent which, using the --enable-ssh-support option, can implement the agent protocol used by SSH.

Requirements

A working gpg2 setup is required. It may be possible to use gpg 1.4 but with gpg-agent compiled from gpg2. If you are using OS X 10.9 (Mavericks) then you may find the instructions [here][1] useful.

@nasser
nasser / atom-shell-arm-build.sh
Last active March 29, 2016 17:51
Cross compile atom-shell to ARM from Ubuntu 14.04
# from https://github.com/atom/atom-shell/blob/master/docs/development/build-instructions-linux.md
# run as root on ubuntu 14.04
# basic deps
apt-get install build-essential clang libgtk2.0-dev libnotify-dev gcc-multilib g++-multilib libgnome-keyring-dev
# node
apt-get install python-software-properties software-properties-common
add-apt-repository ppa:chris-lea/node.js
apt-get update
@mattparker
mattparker / installing gcov and ltp for php.md
Last active December 3, 2023 05:08
trying to compile php with gcov
vagrant@php7dev:~/php-src$ ./configure --enable-gcov --prefix=/usr/local/php70-gcov

gives, eventually:

configure: error: To enable code coverage reporting you must have LTP installed
@Nervengift
Nervengift / rofi-pulse-sink.sh
Last active August 10, 2022 08:30
Choose pulseaudio sink via rofi/dmenu
#!/usr/bin/bash
# choose pulseaudio sink via rofi or dmenu
# changes default sink and moves all streams to that sink
sink=$(ponymix -t sink list|awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}'|rofi -dmenu -p 'pulseaudio sink:' -location 6 -width 100|grep -Po '[0-9]+(?=:)') &&
# alternate version using dmenu:
# sink=$(ponymix -t sink list|awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}'|dmenu -p 'pulseaudio sink:'|grep -Po '[0-9]+(?=:)') &&
ponymix set-default -d $sink &&
for input in $(ponymix list -t sink-input|grep -Po '[0-9]+(?=:)');do
@odan
odan / xampp_php7_xdebug.md
Last active June 28, 2024 12:58
Installing Xdebug for XAMPP
@Jeff-Russ
Jeff-Russ / Array Objects in PHP.md
Last active May 27, 2024 05:43
PHP: ArrayObject, IteratorAggregate , ArrayAccess , Serializable , Countable

Array Objects in PHP

Array are not object in PHP but PHP does give us some ways to make object that act like arrays. First, there is the ArrayObject class which is pretty close to what you have with a normal array (you can iterate it, use [] etc.) If you use it as a parent for your class you can add methods to it.

class ArrObj extends ArrayObject{
	// add methods here