Skip to content

Instantly share code, notes, and snippets.

View polidog's full-sized avatar
🌎

Ryota Mochizuki polidog

🌎
View GitHub Profile
@bubba-h57
bubba-h57 / Serializor.php
Created September 13, 2012 14:49
Doctrine 2 Entities Serialized to JSON
<?php
namespace H57\Util;
class Serializor {
/**
* Converts the Doctrine Entity into a JSON Representation
*
* @param object $object The Object (Typically a Doctrine Entity) to convert to an array
@tentacode
tentacode / list.html.twig
Created October 15, 2012 12:23
Twig recursive macro
{% macro recursiveCategory(category) %}
<li>
<h4><a href="{{ path(category.route, category.routeParams) }}">{{ category }}</a></h4>
{% if category.children|length %}
<ul>
{% for child in category.children %}
{{ _self.recursiveCategory(child) }}
{% endfor %}
</ul>
@kjantzer
kjantzer / InfiniteListView.js
Last active October 22, 2021 20:41
Backbone.js: Infinite Scrolling List View
/*
Infinite List View
creates <ul> with triggers for infinite scrolling
@author Kevin Jantzer, Blacktone Audio Inc.
@since 2012-11-06
USE - listen for:
@mokemokechicken
mokemokechicken / Chef.md
Created November 9, 2012 05:45
Chef勉強会下書き

Chefとは

  • インフラ・ミドルウェア・アプリケーション構成の設定・管理フレームワーク
  • CUIコマンドベースでなく、Rubyベースで記述する
  • 一度書けば、誰でも実行できたり、再利用できるのが嬉しい
  • 類似フレームワークとしては、Puppetが有名

Chefのメリット

@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@K-Phoen
K-Phoen / config.yml
Created December 18, 2012 11:22
Storing Symfony2 sessions in memcached
imports:
# ....
- { resource: services/session.yml }
framework:
# ....
session:
handler_id: session.handler.memcached
@toomasr
toomasr / nginx.conf
Created January 4, 2013 12:20
nginx configuration for the Wordpress blog post
upstream servers-frontend {
ip_hash;
server 10.10.137.100:80; # server-1
server 10.10.126.101:80; # server-2
}
upstream server-2 {
server 10.10.137.101:80;
}
Jenkins × PHP環境構築の巻
■目的
PHP環境に対応したJenkins設定を行い、
コミットされる度にサーバ上でのPHPUnitの実行 及び
カバレッジレポート出力を"全自動"で行えるようにすること。
1) PHP Pear系のインストール
sudo pear channel-discover pear.phing.info
sudo pear channel-discover pear.pdepend.org
@danvbe
danvbe / 1-Explanations.md
Last active February 20, 2025 12:31
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
@ryugoo
ryugoo / stylus.jmk.js
Last active December 11, 2015 17:49
Stylus to Alloy JMK
var fs = require("fs");
var path = require("path");
var util = require("util");
var styl = require("stylus");
var wrench = require("wrench");
function compileTSS(root, view) {
var data = fs.readFileSync(path.join(root, view), "utf8"),
tss;
styl.render(data, function (err, css) {