Debounce a function when you want it to execute only once after a defined interval of time. If the event occurs multiple times within the interval, the interval is reset each time.
Example A user is typing into an input field and you want to execute a function, such as a call to the server, only when the user stops typing for a certain interval, such as 500ms.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined('_PS_VERSION_')) exit; | |
class TD_Shortcode extends Module { | |
protected static $initialized = false; | |
public function __construct() { | |
$this->name = 'td_shortcode'; | |
$this->tab = 'front_office_feature'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.app.Service; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.os.Bundle; | |
import android.os.IBinder; | |
import android.support.v4.content.LocalBroadcastManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media only screen{ | |
[class*="block-grid-"] { | |
display:block; | |
zoom:1; | |
margin:0 -.625em; | |
padding:0; | |
} | |
[class*="block-grid-"]:before, | |
[class*="block-grid-"]:after { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function example_form_element_label($variables) { | |
$element = $variables['element']; | |
// This is also used in the installer, pre-database setup. | |
$t = get_t(); | |
// If title and required marker are both empty, output no label. | |
if ((!isset($element['#title']) || $element['#title'] === '') && empty($element['#required'])) { | |
return ''; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload | |
var fs = require('fs'); | |
var AWS = require('aws-sdk'); | |
AWS.config.loadFromPath('./aws-config.json'); | |
var s3 = new AWS.S3(); | |
// File | |
var fileName = '5.pdf'; | |
var filePath = './' + fileName; | |
var fileKey = fileName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.lt-ie9 .top-bar { | |
background: #2f2f2f; | |
*zoom: 1; | |
overflow: visible; | |
} | |
.lt-ie9 .top-bar:before, .lt-ie9 .top-bar:after { | |
content: " "; | |
display: table; | |
} | |
.lt-ie9 .top-bar:after { clear: both; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The Grid ---------------------- */ | |
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; } | |
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
.lt-ie9 .row.large-collapse .column, | |
.lt-ie9 .row.large-collapse .columns { padding: 0; } | |
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
.lt-ie9 .row .row.large-collapse { margin: 0; } | |
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; } | |
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; } |
NewerOlder