Skip to content

Instantly share code, notes, and snippets.

@Maff-
Maff- / jsdomjquery.js
Created February 16, 2011 19:33
Demo setup of jsdom + htmlparser + jquery on Node (v0.4.0). Not sure if this is the right way to do it, please fork/comment if you have suggestions.
/**
* jsdom + htmlparser + jQuery @ Node v0.4.0
* use npm to install jsdom & htmlparser:
* $ npm install jsdom@0.1.23
* $ npm install htmlparser
*
* Note: not sure what versions work or not
*
* https://github.com/tmpvar/jsdom
* https://github.com/tautologistics/node-htmlparser
@Maff-
Maff- / projectedTexture_frag.glsl
Created May 16, 2011 13:52
A small update to Paul Houx's projectedTextureSample for Cinder
uniform sampler2D projectorTexture;
uniform sampler2DShadow projectorDepthMap;
uniform bool renderAmbient;
uniform bool renderDiffuse;
uniform bool renderSpecular;
uniform bool renderShadow;
uniform bool renderGobo;
uniform bool renderNormal;
@Maff-
Maff- / test
Created March 7, 2012 22:22
nginx 'catch all' config
server {
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
root /var/www/test;
index index.php index.html index.htm;
server_name test.localhost;
location / {
<?php
$ttl = 60*60*2; // 2 hours
parse_str($_SERVER['QUERY_STRING'], $q);
$out = array();
if (!empty($q['r']) && function_exists('apc_fetch')) {
if (!apc_exists('test-' . $q['r'])) {
header("Status: 404 Not Found");
@Maff-
Maff- / cod2_client_host_search_lan.txt
Created August 17, 2013 12:16
Call of Duty 2 game client searching for LAN servers
No. Time Source Destination DstPort Protocol Length Info
87 7.931300000 192.168.1.21 255.255.255.255 28960 UDP 57 Source port: 28960 Destination port: 28960
Frame 87: 57 bytes on wire (456 bits), 57 bytes captured (456 bits) on interface 0
Ethernet II, Src: 192.168.1.21 (00:9c:02:8e:cd:70), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 192.168.1.21 (192.168.1.21), Dst: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: 28960 (28960), Dst Port: 28960 (28960)
Data (15 bytes)
0000 ff ff ff ff ff ff 00 9c 02 8e cd 70 08 00 45 00 ...........p..E.
@Maff-
Maff- / phpstorm7-colorscheme-default.xml
Created February 22, 2014 09:46
Export of Jetbrains PhpStorm 7 (IDEA 13) default colorscheme
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="CopyOfDefault" version="124" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Monospaced" />
<colors />
<attributes>
<option name="ABSTRACT_CLASS_NAME_ATTRIBUTES">
<value />
</option>
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@Maff-
Maff- / projects.conf
Last active August 29, 2015 14:13
Dynamic Apache projects vhost
<VirtualHost *:80>
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/projects
<Directory /var/www/projects>
# enable the .htaccess rewrites
AllowOverride All
Require all granted
@Maff-
Maff- / BoolChoiceType.php
Created June 16, 2015 20:25
Symfony: Boolean as [No, Yes] radio Choice list
<?php
namespace AppBundle\Form\Type;
use AppBundle\Form\DataTransformer\BoolToIntTransformer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class BoolChoiceType extends AbstractType
@Maff-
Maff- / config.yml
Last active August 29, 2015 14:23
PhpStormProtocol
# [...] #
framework:
# Uncomment the 'ide' option to turn all of the file paths in an exception
# page into clickable links that open the given file using your favorite IDE.
# Supported values are 'textmate', 'macvim', 'emacs' and 'sublime' shortcuts
# and any custom configuration string, such as: "phpstorm://open?file=%%f&line=%%l"
# See http://symfony.com/doc/current/reference/configuration/framework.html#ide
ide: "pstorm://open?file=%%f&line=%%l"