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
using UnityEngine;
public class CameraController : MonoBehaviour
{
[Header("Camera Movement Options")]
public float keyboardPanSpeed = 100f;
public float mousePanSpeed = 50f;
public float mousePanBaseSpeed = 0.01f;
public float zoomSpeed = 50f;
public float edgeSize = 20f;

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
<?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
[6] pry(main)> x = { foo: "bar" }
=> {:foo=>"bar"}
[7] pry(main)> Marshal.dump(x)
=> "\x04\b{\x06:\bfooI\"\bbar\x06:\x06ET"
[8] pry(main)>
class Route {
def self.reader(v) {
define_method(v, \{ get_instance_variable(v) });
}
reader('verb);
reader('path);
reader('callable);
def init(verb, path, callable) {
@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
@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
<?php
/**
* FixIt
* PHP Error Handling Library
* @author Filipe Dobreira
* @version 1
* @license MIT
*/
namespace FixIt;
use \set_error_handler,
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'
},
@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,