Skip to content

Instantly share code, notes, and snippets.

View novrian's full-sized avatar
jangan lupa ngopi

Nono Novrian novrian

jangan lupa ngopi
View GitHub Profile
@novrian
novrian / cakegittmpdirs
Last active December 14, 2015 03:49 — forked from tijmenb/cakegittmpdirs
# Based on: http://stackoverflow.com/questions/2218075/using-git-with-your-cakephp-project
# Procedure:
# 1. Remove app/tmp/ from .gitignore
# 2. touch app/tmp/empty
# 3. git add app/tmp/empty
# 4. git commit
# 5. Add app/tmp/ to .gitignore
# Clean tmpfiles and delete .gitignore
/*
* Inspired by:
* http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery
*
* This script is ideal for getting specific class depending on device width
* for enhanced theming. Media queries are fine in most cases but sometimes
* you want to target a specific JQuery call based on width. This will work
* for that. Be sure to put it first in your script file. Note that you could
* also target the body class instead of 'html' as well.
* Modify as needed
// Base on awesome work from:
// Mason Wendell http://thesassway.com/intermediate/responsive-web-design-in-sass-using-media-queries-in-sass-32
// Jason Cypret http://jasoncypret.com/responsive-sass-mixin/
@mixin respond-to($media) {
@if $media == smartphone {
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) { @content }
} @else if $media == smartphone-l {
@media only screen and (min-width : 321px) { @content }
} @else if $media == smartphone-p {
@media only screen and (max-width : 320px) { @content }
#!/bin/sh
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
@novrian
novrian / bootstrap_pagenavi.php
Last active September 19, 2018 08:09
Wordpress Pagenavi Helper to display pagenavi like Twitter Bootstrap Pagination
<?php
/**
* Twitter Bootstrap Pagenavi
*
* This is tweaks function to display WP-Pagenavi markup that displayed like
* Twitter Bootstrap Pagination.
*
* Do not fille the pagenavi's options below:
* - Text For Number Of Pages
* - Text For `First` / `Last Page`
@novrian
novrian / yoast-bootstrap-breadcrumb.php
Last active March 14, 2019 16:09
Yoast Breadcrumb with Twitter Bootstrap Markup
<?php
/**
* Yoast Breadcrumbs on Twitter Bootstrap
*
* @author Novrian <me@novrian.info>
* @copyright (c) 2013. Novrian Y.F.
* @license MIT License
* @param string $sep Your custom separator
*/
function novrian_breadcrumbs($sep = '/') {
@novrian
novrian / sprite-cache.rb
Created September 11, 2013 15:15
Put this on your config.rb to make compass generate sprite without hash.
# Thanks to piouPiouM
#
# @see http://stackoverflow.com/questions/9183133/how-to-turn-off-compass-sass-cache-busting/9332472#9332472
# @link http://pioupioum.fr/developpement/compass-sprites-supprimer-cache-buster.html
# Make a copy of sprites with a name that has no uniqueness of the hash.
on_sprite_saved do |filename|
if File.exists?(filename)
FileUtils.cp filename, filename.gsub(%r{-s[a-z0-9]{10}\.png$}, '.png')
end
@novrian
novrian / strip-unit.scss
Created October 8, 2013 05:22
Strip Unit SASS Function
// Thanks to @robwierzbowski on github
// See https://github.com/nex3/sass/issues/533#issuecomment-11675408
@function strip-units($value) {
@return $value / ($value * 0 + 1);
}

Awesome PHP

A curated list of amazingly awesome PHP libraries, resources and shiny things.

Categories

  • Composer
  • Composer Related
  • Frameworks
  • Framework Components
@novrian
novrian / Select2.php
Created January 20, 2017 11:35 — forked from tortuetorche/Select2.php
Select2 v3.5 helpers for the WebDriver module of Codeception 2.1 (WIP)
<?php
namespace Helper;
// Select2 helpers for the jQuery based replacement for select boxes.
// See: http://select2.github.io/select2
// Author: Tortue Torche <tortuetorche@spam.me>
// License: MIT
//
// Installation:
// * Put this file in your 'tests/_support/Helper' directory