Skip to content

Instantly share code, notes, and snippets.

View filp's full-sized avatar
🖨️
i like computer

Filipe Dobreira filp

🖨️
i like computer
  • Lisbon, Portugal
View GitHub Profile
prompt() {
last_status="$?"
color_base="\[\e[0m\]"
color_red_bold="\[\e[1;31m\]"
color_green_bold="\[\e[1;35m\]"
color_yellow_light="\[\e[0;33m\]"
git_branch=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ $last_status -eq "0" ]
then
@filp
filp / gist:2918129
Created June 12, 2012 15:16
wat is this
<?php
// this is not good.
class ColorString
{
protected $string;
protected static $codes = [
'reset' => 0,
'bright' => 1,
'bold' => 1,
window.olx = window.olx || {};
window.olx.Ticker = (function(document, window, undefined) {
var Backbone = window.Backbone,
$g = window.jQuery;
var TickerComponent = Backbone.View.extend({
events : {
'keydown' : 'onKeydown',
'blur' : 'onKeydown'
},
<?php
/**
* FixIt
* PHP Error Handling Library
* @author Filipe Dobreira
* @version 1
* @license MIT
*/
namespace FixIt;
use \set_error_handler,
@filp
filp / botbot.gridlang
Last active December 11, 2015 16:38
botbot is the meanest bot in town
# botbot
# how 2 gridlang
# get initial direction
STORE dir << @WEST
CALL << @wtfmove
# main loop
@botbot
# move around randomly and steal everything we can
@filp
filp / gist:5207588
Created March 20, 2013 19:17
Blade blows up when iterating an empty array, and for example calling a method on the placeholder variable
<?php
/**
* Controller:
*/
return View::make('foo', array( 'test' => array() ))
/**
* foo.blade.php
class Route {
def self.reader(v) {
define_method(v, \{ get_instance_variable(v) });
}
reader('verb);
reader('path);
reader('callable);
def init(verb, path, callable) {
[6] pry(main)> x = { foo: "bar" }
=> {:foo=>"bar"}
[7] pry(main)> Marshal.dump(x)
=> "\x04\b{\x06:\bfooI\"\bbar\x06:\x06ET"
[8] pry(main)>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKSpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMXGyImVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NHMCAwIDAgMUYwIDAg
MAAQAYACgAbSFA0VFlVOU0lDQ4ADgAXSGA0ZGldOUy5kYXRhTxEPNAAADzRhcHBsAhAA

Systems Engineer Project

SFTP watcher

Using Docker, and other tools of your choice, your task is to build a simple SFTP server & notification system, by combining two containers:

  • Container A runs the SFTP server
  • Container B runs a script or service that monitors the directory served by Container A for new files, and prints their path to STDOUT