Skip to content

Instantly share code, notes, and snippets.

View anveo's full-sized avatar
🤘

Brian Racer anveo

🤘
View GitHub Profile
/* This works when jQuery is not included */
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("myytplayer");
ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
}
function onytplayerStateChange(newState) {
console.debug("Player's new state: " + newState);
}
protected function processForm(sfWebRequest $request, sfForm $form)
{
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
if ($form->isValid())
{
$file = $form->getValue('file');
if($file)
{
$ad->setMimeType($form->getValue('file')->getType());
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql
# On Mac OS X:
# sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
# On Mac OS X Leopard:
# sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
# This sets the ARCHFLAGS environment variable to your native architecture
# On Windows:
#divFileProgressContainer
height: 75px
#divFileProgress
.progressWrapper
width: 100%
overflow: hidden
.progressContainer
= render 'shared/header'
= yield
= render 'shared/footer'
module Rack
class AddAccessControlHeader
def initialize app, opts
@app = app
@extensions = opts
end
def call(env)
response = @app.call(env)
headers = Utils::HeaderHash.new(response[1])
# Flush all current rules from iptables
iptables -F
# Set default policies for INPUT, FORWARD and OUTPUT chains
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
#
# Permit packets in to firewall itself that are part of existing and related connections.
*filter
# Flush all current rules from iptables
-F
# log iptables denied calls
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
# Set default policies for INPUT, FORWARD and OUTPUT chains
-P INPUT DROP
LoadModule passenger_module /opt/rubyee/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /opt/rubyee/lib/ruby/gems/1.8/gems/passenger-2.2.5
PassengerRuby /opt/rubyee/bin/ruby