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
[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,
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