Skip to content

Instantly share code, notes, and snippets.

View meddulla's full-sized avatar

Sofia meddulla

  • Cloudflare
  • Portugal
View GitHub Profile
@meddulla
meddulla / .htaccess
Created May 12, 2011 23:08
restfull output urls for code igniter
<IfModule mod_rewrite.c>
RewriteEngine On
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
#Submitted by Michael Radlmaier (mradlmaier)
@meddulla
meddulla / line_log.vim
Created May 28, 2011 01:42
Write current line with date, time, path/to/file and start/end flag to log file in Vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" line_log.vim
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Authors: Sofia Cardita <sofiacardita AT gmail DOT com>, Andy Dawson <andydawson76 AT gmail DOT com>
" Version: 1.3.1
" Licence: http://www.opensource.org/licenses/mit-license.php
" The MIT License
" URL: https://gist.github.com/996505
" URL: http://github.com/AD7six/vim-activity-log
@meddulla
meddulla / inatll node
Created August 6, 2011 12:23
install node in macosx snow leopard
$ echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bash_profile
$ . ~/.bash_profile
$ mkdir ~/local
$ mkdir ~/node-latest-install
$ cd ~/node-latest-install
$ curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
$ export PATH=/Developer/usr/bin:$PATH
$ ISYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
$ export LINKFLAGS=$ISYSROOT CXXFLAGS=$ISYSROOT CFLAGS=$ISYSROOT
$ ./configure --prefix=~/local --without-ssl
@meddulla
meddulla / .htaccess
Created September 5, 2011 17:16
iis web.config
<IfModule mod_rewrite.c>
RewriteEngine On
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
#Submitted by Michael Radlmaier (mradlmaier)
@meddulla
meddulla / replacer.py
Created October 4, 2011 19:00
Script to recursively replace string in filename and contents
"""
Usage: python script.py search_string replace_string dir
Eg. python batchreplace.py galleries productions /Sites/cjc/application/modules/productions/
And it will search recursively in dir
and replace search_string in contents
and in filenames.
Case-sensitive
"""
from sys import argv
@meddulla
meddulla / .vimrc.local
Created October 12, 2011 09:48
Vim local config alongside https://github.com/spf13/spf13-vim config
""php beautifier
map <C-b> :% ! php_beautifier --filters "PEAR() DocBlock()"<CR>
""set guifont=Inconsolata:h16
""set guifont=PanicSans:h13
set guifont=Menlo:h13
""NerdTree
map <D-e> :NERDTreeToggle<CR>:NERDTreeMirror<CR>
map <S-e> :NERDTreeFind<CR>
@meddulla
meddulla / .gitconfig
Created October 31, 2011 18:30
.gitconfig
[user]
name = **
email = **@gmail.com
[color]
diff = auto
status = auto
branch = auto
[github]
user = **
token = **
@meddulla
meddulla / minimal.js
Created December 22, 2011 20:02
Very Minimal js router - just tests if given element exists in page
//(c) 2011 Sofia Cardita
//freely distributable under the MIT license.
//deps: jquery, jqueryStorage, handlebarsjs
(function(){
// Initial Setup
// -------------
var MyApp;
if (typeof exports !== 'undefined') {
MyApp = exports;
@meddulla
meddulla / ModelTestCase.php
Created February 3, 2012 12:15 — forked from wowo/ModelTestCase.php
Model Test Case, which loads fixtures and builds database before each test
<?php
require_once(__DIR__ . "/../../../../app/AppKernel.php");
class ModelTestCase extends \PHPUnit_Framework_TestCase
{
protected $_application;
public function setUp()
{
@meddulla
meddulla / config_test.yml
Created February 3, 2012 12:31
symfony 2 test configuration
imports:
- { resource: config_dev.yml }
framework:
test: ~
session:
storage_id: session.storage.filesystem
doctrine:
dbal: