Skip to content

Instantly share code, notes, and snippets.

View siriokun's full-sized avatar
All Included (AI) scope of work

Rio Purnomo siriokun

All Included (AI) scope of work
View GitHub Profile
//jQuery
if ( $(".some-element").filter(":focus").length >= -1 ) {
//$(".some-element") contains 1 item, and it is focussed
}
if($(".some-element")[0] == document.activeElement) {
//first element of object is selected
}
@siriokun
siriokun / gist:6f61a454d82dcd0ae1a6
Last active August 29, 2015 14:01 — forked from replete/gist:3048826
Add class to <body> based on viewport width (IE7+, possibly IE6+)
var d = document,
b = d.getElementsByTagName("body"),
w = window,
c = "className",
v = (function() { return w.innerWidth || d.documentElement.clientWidth }),
r = function () {
i = v();
if (i < 181) { b[0][c] = "max-180"; return }
if (i < 246) { b[0][c] = "max-245"; return }
else { b[0][c] = "" }
(function($){
$.fn.autoGrowInput = function(o) {
o = $.extend({
maxWidth: 1000,
minWidth: 0,
comfortZone: 70
}, o);
// Hastily plonked together by @replete, phil@replete.nu
/* Use like this:
<div class="some-html-chunk" data-sync-height="a-unique-name">Foo</div>
<div class="some-other-html-chunk" data-sync-height="a-unique-name">Bar</div>
*/
$('[data-sync-height]')
.each(function(i,e){
/*
LayoutBreakpoints - Sync JS with your CSS media queries - yay!
After painfully discovering that there is no hope for IE7 (and others) to read
content properties with generated content, I resolved to this solution.
If it doesn't work for you, you could easily change getElementsByTagName to
getElementsById and pop an ID attribute onto an element of your choosing.
See an example here: http://replete.github.io/FitTextNow/example.html (view-source)
@siriokun
siriokun / config.json
Last active August 29, 2015 14:26 — forked from anonymous/config.json
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": "#22B5BF",
"@brand-success": "#88C134",
@siriokun
siriokun / .jsbeautifyrc
Created May 30, 2017 04:49 — forked from wzup/.jsbeautifyrc
.jsbeautifyrc file example
{
// The plugin looks for a .jsbeautifyrc file in the same directory as the
// source file you're prettifying (or any directory above if it doesn't exist,
// or in your home folder if everything else fails) and uses those options
// along the default ones.
// Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options
// Documentation: https://github.com/einars/js-beautify/
"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "dust"],
@siriokun
siriokun / functions.php
Created November 2, 2017 07:56 — forked from gamaup/functions.php
Reorder Checkout Fields
<?php
/* WooCommerce < 3.0.4 */
add_filter('woocommerce_checkout_fields','reorder_fields');
function reorder_fields($fields) {
$billing_field_order = array(
'billing_first_name',
'billing_last_name',
'billing_address_1',
'billing_email',
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
/* purgecss start ignore */
@tailwind base;
@tailwind components;
/* purgecss end ignore */
/*
...
...
...other css
...