Skip to content

Instantly share code, notes, and snippets.

View u01jmg3's full-sized avatar
🔷
Coding Hard

Jonathan Goode u01jmg3

🔷
Coding Hard
View GitHub Profile
(function() {
// see https://github.com/brianreavis/selectize.js/issues/470
// extended from https://gist.github.com/bkosborne/56ee6a6559ac66d64490
// gist at https://gist.github.com/thiago-negri/132bf33b5312e2da823c
Selectize
.define('no_results', function(options) {
var self = this;
options = $
anonymous
anonymous / config.json
Created October 6, 2015 11:19
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#ea4e1b",
"@brand-success": "#5cb85c",
@adactio
adactio / placeholderFromDatalist.js
Created August 12, 2012 15:54
Generate a placeholder attribute from the datalist associated with that input.
(function(win,doc) {
if (doc.querySelectorAll) {
var inputs = doc.querySelectorAll('input[list]'),
total = inputs.length;
for (var i=0; i<total; i++) {
var input = inputs[i],
id = input.getAttribute('list'),
list = doc.getElementById(id),
options = list.getElementsByTagName('option'),
amount = options.length,
@ericwoodruff
ericwoodruff / .gitconfig
Created December 8, 2013 19:50
Inverting git index
[alias]
swaplast = !git tag _invert && git reset --hard HEAD~2 && git cherry-pick _invert _invert~1 && git tag -d _invert
invertindex = !git commit -m tmp1 && git add -A && git commit -m tmp2 && git swaplast && git reset HEAD~1 && git reset HEAD~1 --soft
@dgg
dgg / build.js
Last active August 23, 2017 14:48
automating-phonegap-builds-with-gulp
gulp.task('build', gulpsync.sync(['unlock', 'compress']), function () {
var endpoint = '/apps/' + config.phoneGap.appId;
var env = config.ensure.environment(argv.env, argv.debugmode);
pgBuild.auth({ token: config.phoneGap.authToken }, function (e, api) {
gulp.src('tmp/*.zip').pipe(tap(function (file, t) {
var options = {
form: {
data: {
@hashchange
hashchange / scrollTargetPosition.js
Created August 17, 2015 14:16
Returns the scroll target position for scrolling to the top of an element.
/**
* Returns the scroll target position for scrolling to the top of an element.
*
* Pass the result to a scrollTo method:
*
* - $scrollContainer.scrollTop( result ) for instant scrolling
* - $scrollContainer.scrollTo( result ) for animated scrolling with jQuery.scrollable
*
* @param {jQuery} $target the target element
* @param {jQuery} $scrollContainer either $(window), or a scrollable HTML element
@imbrish
imbrish / MacroServiceProvider.php
Created January 30, 2018 14:46
Locale-aware & multi-key sorting of arrays
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Support\ServiceProvider;
class MacroServiceProvider extends ServiceProvider
{
/**
@40
40 / revLine.txt
Created September 22, 2012 03:20
Reverse Line Order of Code in Notepad++
INSTRUCTIONS
Edit > Select All
TextFX > TextFX Tools > Insert Line Numbers
If TextFX > TextFX Tools > +Sort ascending is checked, uncheck it
TextFX > TextFX Tools > Sort lines case sensitive (at column)
TextFX > TextFX Tools > Delete Line Numbers or First Word
@HaNdTriX
HaNdTriX / selectize.inputmaxlength.plugin.js
Last active April 19, 2018 17:09
Selectize Plugin to allow to set a maxlength
Selectize.define('inputMaxlength', function(options) {
var self = this;
this.setup = (function() {
var original = self.setup;
return function() {
original.apply(this, arguments);
this.$control_input.attr('maxlength', this.settings.inputMaxlength);
};
})();
});
@philsturgeon
philsturgeon / 0-intro.md
Last active June 7, 2018 09:34
PSR-2 v CodeSniffer PSR-2

This is a list of issues or discrepencies between the wording or intention of PSR-2 itself and the CodeSniffer PSR-2 ruleset.

Add suggestions in the comments or tweet me (@philsturgeon) if you have more inconsistencies to report.