Skip to content

Instantly share code, notes, and snippets.

View Skarlso's full-sized avatar
:shipit:

Gergely Brautigam Skarlso

:shipit:
View GitHub Profile
#!/bin/bash
# Derived from http://weierophinney.net/matthew/archives/134-exuberant-ctags-with-PHP-in-Vim.html
exec etags \
--languages=PHP \
--langmap=PHP:+.phpt \
-h ".php" -R \
--exclude="\.git" \
--totals=yes \
--tag-relative=yes \
--PHP-kinds=+cdf \
@senko
senko / onchange.sh
Last active July 14, 2023 07:54
OnChange - Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@cangelis
cangelis / command.class.php
Last active June 21, 2023 02:03
A simple Command Pattern implementation (Calculator example) on PHP
<?php
abstract class Command {
abstract public function unExecute ();
abstract public function Execute ();
}
class concreteCommand extends Command {
private $operator,$operand,$calculator;
public function __construct ($calculator,$operator,$operand) {
$this->operator = $operator;
$this->operand = $operand;
@spikebike
spikebike / client.go
Created March 29, 2012 01:13
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active August 25, 2024 15:05
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ardan-bkennedy
ardan-bkennedy / GoMgoSample-1.go
Last active February 27, 2021 08:31
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
@ChengLong
ChengLong / ruby_cron.md
Created April 17, 2014 06:34
Run Ruby Script using cron job

If you see this error when cron job runs a ruby script:

'require': cannot load such file ...

And you are using bundler e.g. require 'bundler/setup'. It's probably because the directory where cron runs the script is not correct, resulting in bundler fails to load gems.

Simply changed the directory to fix it, i.e.

* * * * * /usr/local/bin/ruby -C /home/example/scripts example_script.rb >>/home/example/log/cron.log 2>&1

@staltz
staltz / introrx.md
Last active August 25, 2024 19:43
The introduction to Reactive Programming you've been missing
@kachayev
kachayev / concurrency-in-go.md
Last active August 22, 2024 14:20
Channels Are Not Enough or Why Pipelining Is Not That Easy
@yitsushi
yitsushi / Makefile
Last active April 15, 2016 11:44
Epic Makefile for Go. (make help for more info)
all: cover build
coverFile := $(shell mktemp -u -t cover.out.XXXXXX)
projectName := $(shell basename `pwd`)
hasGocov := #$(shell which gocov)
packages := $(shell go list ./...)
ifndef OUTPUT
OUTPUT = "text"
endif