Skip to content

Instantly share code, notes, and snippets.

@rpc("any_peer")
func fire():
var sender_id = multiplayer.get_remote_sender_id()
var sender = get_node("/root/Multiplayer/SpawnPoint/" + str(sender_id))
var b = bullet.instantiate()
b.name = str(sender_id) + str(seq)
seq += 1
b.transform = sender.transform
@mrosati84
mrosati84 / settings.php
Created November 22, 2016 15:21
Drupal 8 reverse proxy settings
<?php
/**
* Reverse Proxy Configuration:
*
* Reverse proxy servers are often used to enhance the performance
* of heavily visited sites and may also provide other site caching,
* security, or encryption benefits. In an environment where Drupal
* is behind a reverse proxy, the real IP address of the client should
* be determined such that the correct client IP address is available
@mrosati84
mrosati84 / hoisting.js
Created December 25, 2012 11:15
this gist explains function hoisting in javascript
(function () {
function foo() {
console.log('foo');
}
function bar() {
console.log('bar');
}
function hoistMe() {
@mrosati84
mrosati84 / responsive_iframe_slider.html
Last active May 24, 2019 15:51
Demo responsive iframe slider
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css">
<style type="text/css">
#slider {
width: 100%;
}
@mrosati84
mrosati84 / tmux.conf
Last active March 8, 2017 14:36
My tmux configuration file
unbind C-b
set -g default-terminal screen-256color
set -g prefix C-a
bind C-a send-prefix
# fiddle with colors of status bar
set -g status-fg white
set -g status-bg colour234
# fiddle with colors of inactive windows
@mrosati84
mrosati84 / .vimrc
Last active March 8, 2017 14:32
My .vimrc file
execute pathogen#infect()
syntax on
set ruler " show the line number on the bar
set more " use more prompt
set autoread " watch for file changes
set number " line numbers
set autoindent smartindent " auto/smart indent
set smarttab " tab and backspace are smart
filetype on " Enable filetype detection
@mrosati84
mrosati84 / capture.js
Last active August 3, 2016 16:37
Test automation for responsive layout using PhantomJS
/*
requires: phantomjs, async
usage: phantomjs capture.js
*/
var async = require('async'),
sizes = [
[320, 480],
[1024, 768],
[1280, 800],
@mrosati84
mrosati84 / toggleClass.html
Created October 2, 2013 10:52
Simple toggleClass implemented in AngularJS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.is-active {
color: red;
}
</style>
@mrosati84
mrosati84 / angular_http_request
Created March 13, 2013 11:33
An Angular.js example for making XHR calls
---
The html file "index.html"
---
<!DOCTYPE html>
<html ng-app>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.1/angular.min.js"></script>
@mrosati84
mrosati84 / restful_pattern.txt
Created January 5, 2013 19:48
Restful resource definition pattern
GET /photos index display a list of photos
GET /photos/new new return an HTML form for creating a new photo
POST /photos create create a new photo
GET /photos/:id show display a specific photo
GET /photos/:id/edit edit return an HTML form for editing a new photo
PUT /photos/:id update update a specific photo
DELETE /photos/:id destroy delete a specific photo