Skip to content

Instantly share code, notes, and snippets.

View dented's full-sized avatar
🎯
Focusing

Gram dented

🎯
Focusing
View GitHub Profile
@dented
dented / jquery.extend.data-grouping.js
Last active September 15, 2015 03:22
Retrieve Groups of prefixed data attributes (data-options-id, data-options-name, etc)
function camelize(str) {
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter, index) {
return index == 0 ? letter.toLowerCase() : letter.toUpperCase();
}).replace(/\s+/g, '');
}
$.fn.extend({
dataGrouping: function (attributeName) {
var regExp = new RegExp('^' + attributeName),
attributesFound = {};
@dented
dented / gist:dff4f412d0d3a9b9c40f
Created November 4, 2015 07:55 — forked from linickx/gist:3692156
hubot init script for RHEL / CENTOS
#!/bin/bash
# hubot
# chkconfig: 345 20 80
# description: hubot
# processname: hubot
# REFERENCE: http://werxltd.com/wp/2012/01/05/simple-init-d-script-template/
# This script assumes you have a user called "hubot" on your system and that hubot is installed in /opt/hubot
@dented
dented / nginx.conf
Created July 26, 2016 17:11
Nginx Upload Module Chunked
# See http://wiki.nginx.org/HttpUploadModule
location = /upload-restore-archive {
# if resumable uploads are on, then the $upload_field_name variable
# won't be set because the Content-Type isn't (and isn't allowed to be)
# multipart/form-data, which is where the field name would normally be
# defined, so this *must* correspond to the field name in the Rails view
set $upload_field_name "archive";
# location to forward to once the upload completes
@dented
dented / circle.yml
Created November 18, 2016 03:17
RethinkDB for circle ci
machine:
ruby:
version: 2.2.3
general:
branches:
only:
- master
- develop
@dented
dented / trends 2017.md
Last active January 25, 2017 09:08
tech trends for 2017
@dented
dented / libName.js
Created February 7, 2017 10:14
UMD Library Template
/* ****************************************************************************
* libName v0.0.1
*
* libName is a set of functions to wrap libName info and
* Copyright (c) 2017 Gram <g@whub.io> (http://www.whub.io).
* Released under the MIT license. You may obtain a copy of the License
* at: http://www.opensource.org/licenses/mit-license.php).
* ****************************************************************************/
(function(root, factory) {
'use strict';
@dented
dented / manager.rb
Created April 8, 2017 09:39
Support Polymorphic for STI
class Manager < User
def can_do_stuff
end
end
@dented
dented / remove_branches.sh
Created August 17, 2017 17:11
Remove merged branches locally if merged into current branch already
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
@dented
dented / infinite.css
Created August 31, 2017 04:39
Infinity CSS
#infinity {
position: relative;
width: 212px;
height: 100px;
}
#infinity:before,
#infinity:after {
content: "";
@dented
dented / bling.hasText.js
Last active February 22, 2018 04:36
Extend Bling to support text searching selector
$.expr[':']['hasText'] = function(node, index, props){
return node.innerText.contains(props[3]);
}