Skip to content

Instantly share code, notes, and snippets.

View magefad's full-sized avatar

Ruslan Fadeev magefad

  • Russia, Cheboksary, Kazan
View GitHub Profile
@suvozy
suvozy / 1. Enable.md
Last active July 5, 2023 12:29
PHP Dev on Mac OS X 10.10 (PHP, MySQL, Apache, Composer)

Apache

to start it

sudo apachectl start

to stop it

sudo apachectl stop

to restart it

@magefad
magefad / console.formdata.js
Created November 18, 2013 07:27
Display form data in console.table chrome
[].forEach.call(document.querySelectorAll('form'), function (input) {
var table = [];
console.group('HTMLForm "' + input.name + '": ' + input.action);
console.log('Element: ', input, '\nName: ' +
input.name + '\nMethod: ' + input.method.toUpperCase() +
'\nAction: ' + input.action || 'null');
['input', 'textarea', 'select'].forEach(function (control) {
[].forEach.call(input.querySelectorAll(control), function (node) {
<?php
/**
* DuplicateFilter prevents Yii from exposing URLs starting with /index.php/ when showScriptName is false. Such
* URLs are automatically redirected to proper ones.
*
* To use add the following to your controller:
*
* ```php
* public function filters() {
* return array(
@mrgcohen
mrgcohen / Readme.md
Last active November 9, 2022 22:17
Twitter Bootstrap Typeahead autocomplete example

Requirements

  • bootstrap with typeahead
  • jquery

Explanation

This will use bootstrap with typeahead to create an autocomplete search.

@r-sal
r-sal / PHPExcel_Basics.md
Last active May 8, 2024 06:29
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

@alex-gist
alex-gist / capitalize_while_inputting.js
Created March 12, 2012 23:03
jQuery: Capitalize first letter while typing inside input field
<script type="text/javascript" charset="utf-8">
//Capitalize first letter while typing in side of input field
jQuery(document).ready(function($) {
$('#selector').keyup(function(event) {
var textBox = event.target;
var start = textBox.selectionStart;
var end = textBox.selectionEnd;
textBox.value = textBox.value.charAt(0).toUpperCase() + textBox.value.slice(1);
textBox.setSelectionRange(start, end);
});
@joelnet
joelnet / example.html
Created June 3, 2011 18:03
Unobtrusive Knockout support library for jQuery
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}