Skip to content

Instantly share code, notes, and snippets.

View tejastank's full-sized avatar

Tejas Tank tejastank

View GitHub Profile
@tejastank
tejastank / MagentoClient.java
Created June 25, 2012 04:45 — forked from regisbamba/MagentoClient.java
example XML-RPC client for Magento API
import redstone.xmlrpc.XmlRpcClient;
import redstone.xmlrpc.XmlRpcException;
import redstone.xmlrpc.XmlRpcFault;
import java.net.MalformedURLException;
import java.util.HashMap;
import redstone.xmlrpc.XmlRpcArray;
import redstone.xmlrpc.XmlRpcStruct;
public class MagentoClient {
@tejastank
tejastank / gist:3835596
Created October 4, 2012 18:47 — forked from philsturgeon/gist:1529194
PyroCMS Example Module details.php
<?php defined('BASEPATH') or exit('No direct script access allowed');
class Module_Sample extends Module {
public $version = '2.0';
public function info()
{
return array(
'name' => array(
@tejastank
tejastank / video.php
Created October 4, 2012 18:57 — forked from mrkodssldrf/video.php
PyroCMS Video Plugin
<?php
/**
* Video Plugin
*
* Plugin to fetch Videos from various Sites
*
* youtube: {{video:youtube id="youtubeid"}}
* vimeo: {{video:vimeo id="vimeoid"}}
*
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
/*
* Template backbone.js code that encapsulates a
* datatable.net table within a view for a hypothetical ;)
* auction listings application.
*/
var HomeRouter = Backbone.Router.extend({
routes: {
'refresh' : 'refresh',
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */
}
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */
}
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */
# -*- coding: utf-8 -*-
"""
wsgi_app
A wsgi application script to load tryton and also the middleware required
to support Cross Origin Resource Sharing (CORS).
Inspired by the original work at http://codereview.tryton.org/92001/ by
Cedric.
@tejastank
tejastank / app.py
Created December 13, 2013 15:59 — forked from rduplain/app.py
from flask import Flask, send_from_directory
app = Flask(__name__)
@app.route('/base/<path:filename>')
def base_static(filename):
return send_from_directory(app.root_path + '/../static/', filename)

Redirect All Requests To Index.php Using .htaccess

In one of my pet projects, I redirect all requests to index.php, which then decides what to do with it:

Simple Example

This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to index.php:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d