Skip to content

Instantly share code, notes, and snippets.

View pauloelias's full-sized avatar

Paulo Elias pauloelias

View GitHub Profile
<?php
public function cartthrob_pre_process($options)
{
if (isset($_FILES)) {
// load the libraries and models
ee()->load->model('file_upload_preferences_model');
// get upload preferences
$uploadPrefs = ee()->file_upload_preferences_model->get_file_upload_preferences(null, 2);
@media only screen and (min-width: 375px) {
/* iPhone 6 Portrait */
}
@media only screen and (min-width: 414px) {
/* iPhone 6 Plus Portrait */
}
@media only screen and (min-width: 480px) {
/* Medium Sized Mobile */
}
@media only screen and (min-width: 667px) {
<?php
/**
* Register site routes.
*
* @return array
*/
public function registerSiteRoutes()
{
return array(
@arielsalminen
arielsalminen / _pems.scss
Created March 29, 2012 16:13 — forked from mrdanadams/_pems.scss
PX to EMs conversion in Sass
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */
/* Default font size in pixels if not overridden. */
$baseFontSize: 16;
/* Convert PX units to EMs.
Ex: margin-right: pem(16);
*/
@function pem($pxval, $base: $baseFontSize) {
@return #{$pxval / $base}em;
@nathansmith
nathansmith / this-is-madness.css
Last active October 6, 2015 10:36
Examples of CSS selector strength.
* {}
tag {}
[attribute] {}
[attribute="value"] {}
.class {}
@iainurquhart
iainurquhart / gist:3792249
Created September 27, 2012 05:02
#eecms API privelages
// this used to work:
function login_temporary_user()
{
if( $this->EE->session->userdata['member_id'] == 0)
{
$this->EE->session->create_new_session(1, TRUE);
$this->EE->session->userdata['group_id'] = 1;
}
}
{exp:channel:entries
channel="producers"
disable="member_data|categories|category_fields|pagination"
dynamic="no"
url_title="{segment_3}"
}
{exp:stash:set no_results_prefix="nested_"}
{stash:page_title}{title}{/stash:page_title}
@GDmac
GDmac / pi.test_plugin.php
Created September 27, 2012 23:13
test_plugin for conditionals
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$plugin_info = array(
'pi_name' => 'Test_plugin',
'pi_version' => '1.0',
'pi_author' => 'GDmac',
'pi_author_url' => '',
'pi_description' => 'Testing stuff',
'pi_usage' => Test_plugin::usage()
);
@jescalan
jescalan / .profile
Created February 13, 2013 03:46
Create a file called .profile at your user root (~/) and paste this in. Then run the command `source ~/.profile` to reload your terminal.
# path:
PS1='\[\e[0;33m\]⚡\[\e[m\] \[\e[0;31m\]${PWD##*/}\[\e[m\] '
# general shorcuts
alias ll="ls -lahG"
alias reload="source ~/.profile"
alias up="cd .."
alias back="cd -"
alias desktop="cd ~/Desktop"
alias server="python -m SimpleHTTPServer"
@chadcrowell
chadcrowell / gist:5348469
Created April 9, 2013 19:08
Mass delete files from Basecamp Classic. Open files tab in project, paste this into your console and press Enter when prompted to delete each file.
var els = document.querySelectorAll('.left .trash'); for(var i = 0; i < els.length; i++) { els[i].click(); }