Skip to content

Instantly share code, notes, and snippets.

View orionstar's full-sized avatar

László Bóra orionstar

View GitHub Profile
@walesmd
walesmd / MY_Model.php
Created December 6, 2010 03:18
CodeIgniter extended Model Class
<?php if (!defined('BASEPATH')) exit('No direct script access allowed.');
/* MY_Model
* Reorganizes the $DB::result() object passed to it so joined
* tables are child-objects of the result object, rather than
* first-class variables. Pretty strict on the way it works.
*
* Example:
* protected $relationships = array(
* 'has_one' => array(
@pamelafox
pamelafox / senderror.js
Created February 21, 2012 19:20
Sending JS errors to server
function sendError(message, url, lineNum) {
var i;
// First check the URL and line number of the error
url = url || window.location.href;
lineNum = lineNum || 'None';
// If the error is from these 3rd party script URLs, we ignore
// We could also just ignore errors from all scripts that aren't our own
var scriptURLs = [
@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@sardbaba
sardbaba / wordpress-function.php
Last active December 14, 2015 18:29
qtrans_generate_language_list() is a better version of the qtrans_generateLanguageSelectCode() function from qTranslate's Wordpress plugin, originally used to print the languages as an HTML select. This function receive an optional string for the separator that will be echoed and it is able to show your languages as spans followed by separators:…
/**
* Language list Code for non-Widget users
*
* @global array $q_config
* @param string $sep
*/
function qtrans_generate_language_list($sep = " | ") {
global $q_config;
$languages = qtrans_getSortedLanguages();
$num_langs = count($languages);
@intco
intco / ion_auth.sqlite.sql
Created September 2, 2013 06:28
SQL dump of CodeIgniter ion-auth extension for SQLITE database
DROP TABLE IF EXISTS `groups`;
--
-- Table structure for table 'groups'
--
CREATE TABLE `groups` (
`id` integer NOT NULL,
`name` varchar(20) NOT NULL,
`description` varchar(100) NOT NULL,
IMPORTANT
Please duplicate this radar for a Safari fix!
This will clean up a 50-line workaround.
rdar://22376037 (https://openradar.appspot.com/radar?id=4965070979203072)
//////////////////////////////////////////////////////////////////////////////
(Now available as a standalone repo.)
@mauricesvay
mauricesvay / detector.js
Created January 9, 2014 10:23
Original js implementation of face detection
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
@paulirish
paulirish / what-forces-layout.md
Last active June 19, 2024 15:52
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@yidas
yidas / codeiginter-server-config.md
Last active March 1, 2024 01:30
Codeigniter 3 server configuration for Nginx & Apache

Codeigniter 3 server configuration for Nginx & Apache

Web Server Site Configuration

Recommended Apache Configuration

Use the following configuration in Apache's httpd.conf file or within a virtual host configuration. Note that you should set DocumentRoot and ServerName fit to your environment:

@joseluisq
joseluisq / request_comment.mock.js
Created February 25, 2019 12:00
Rocket Chat and Bitbucket Server webhooks integration
// Mock Request Data (Pull Request Comment)
module.exports = {
url: {
hash: null,
search: null,
query: {},
pathname: '/hooks/2f7YhFx2f7YhFx2f7YhFx/hUPO&&)6@HqG_wY^B(2$MK_ivkEU1ix7MK_ivkEU1ix7',
path: '/hooks/2f7YhFx2f7YhFx2f7YhFx/hUPO&&)6@HqG_wY^B(2$MK_ivkEU1ix7MK_ivkEU1ix7'
},
url_raw: '/hooks/2f7YhFx2f7YhFx2f7YhFx/hUPO&&)6@HqG_wY^B(2$MK_ivkEU1ix7MK_ivkEU1ix7',