Skip to content

Instantly share code, notes, and snippets.

View ajmalafif's full-sized avatar
💻

Ajmal Afif ajmalafif

💻
View GitHub Profile
@ajmalafif
ajmalafif / flexslider.js
Last active December 11, 2015 19:28 — forked from dcatkins40/Flexslider to Change Background Image
[wp - forked] - Flexslider to Change Background Image
$(document).ready(function() {
var imgArr = new Array (
<?php
$total = count(get_field('field'));
$count = 1;
while(the_repeater_field('field', $pagenumber)): ?>
'<?php the_sub_field('sub_field'); ?>'<?php if($count < $total){echo ',';} $count++; ?>
<?php endwhile; ?>
);
var n = 0;
@ajmalafif
ajmalafif / blackandwhiteimages.php
Created January 27, 2013 21:21
[wp - forked] - Generate B + W images in WordPress
<?php
add_image_size('thumbnail-bw', 400, 0, false);
add_filter('wp_generate_attachment_metadata','bw_images_filter');
function bw_images_filter($meta) {
$file = wp_upload_dir();
$file = trailingslashit($file['path']).$meta['sizes']['thumbnail-bw']['file'];
list($orig_w, $orig_h, $orig_type) = @getimagesize($file);
$image = wp_load_image($file);
imagefilter($image, IMG_FILTER_GRAYSCALE);
@ajmalafif
ajmalafif / responsive-image.md
Last active December 11, 2015 21:28
[rwd] - Responsive image-handler resources
@ajmalafif
ajmalafif / wordpress.md
Last active December 11, 2015 21:58
[wp] - WordPress ultimate resources checklist
@ajmalafif
ajmalafif / .gitignore
Created February 6, 2013 17:01
[Rails] - some snippets for basic Rails setup
*.rbc
*.sassc
.sass-cache
capybara-*.html
.rspec
.rvmrc
/.bundle
/vendor/bundle
/log/*
/tmp/*
@ajmalafif
ajmalafif / menu.md
Last active December 12, 2015 08:29
[rwd] - Responsive menu navigation
@ajmalafif
ajmalafif / app.css
Last active December 14, 2015 00:19
[wp] - Bootstrap transparent menu with Roots Theme
.navbar .brand {
border-right: none;
color: #fff;
}
.navbar .navbar-inner {
background-color: transparent;
background-image: none;
}
@ajmalafif
ajmalafif / gitio
Created March 8, 2013 13:38 — forked from defunkt/gitio
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
@ajmalafif
ajmalafif / environment_troubleshooting.md
Created March 16, 2013 08:14
[mac] - Environment & Troubleshooting