Skip to content

Instantly share code, notes, and snippets.

View AmmarCodes's full-sized avatar

Ammar Alakkad AmmarCodes

View GitHub Profile
@AmmarCodes
AmmarCodes / Sublime Text Useful Packages.md
Last active December 14, 2015 15:19
Collection of useful packages for web development
@AmmarCodes
AmmarCodes / Things to do after installing Ubuntu.md
Last active December 17, 2015 03:49
Things to do after installing Ubuntu

Things to do after installing Ubuntu

##Performance

  • Update your system.
  • Install additional drivers (for ATI VGA cards check this and this).
  • Install powertop via apt-get, then run it as root (via sudo), go to Tunables tab, and change all items to be Good instead of Bad.
  • Install Jupiter app (for Ubuntu 13.04 check this, for older versions check this, launch it and set performance to be Power Saver or Power On Demand.

##Basics

@AmmarCodes
AmmarCodes / Wordpress plugins.md
Last active December 18, 2015 17:48
List of Wordpress plugins I use mostly

#Useful Wordpress plugins

  • Admin Bar
  • Debug Bar
  • Disable User Gravatar
  • TinyMCE Advanced
  • WP Minify
  • W3 Total Cache
  • Geo Redirect
  • Widget Context
@AmmarCodes
AmmarCodes / Sublime Text configurations
Last active December 22, 2015 11:18
My configurations for Sublime Text 3.
{
"auto_match_enabled": true,
"bold_folder_labels": true,
"caret_extra_bottom": 2,
"caret_extra_top": 2,
"caret_style": "phase",
"color_inactive_tabs": true,
"color_scheme": "Packages/Predawn/predawn.tmTheme",
"detect_slow_plugins": false,
"fade_fold_buttons": true,
@AmmarCodes
AmmarCodes / create-website.sh
Created October 7, 2013 10:26
Help create Apache virtual host on Ubuntu
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
if [ $# -lt 2 ]; then
echo "No arguments supplied!"
echo "Usage: sudo scriptname directory_name server_name"
@AmmarCodes
AmmarCodes / functions.php
Last active December 26, 2015 13:59
Useful functions to include in your theme functions file.
/**
* Dumping a variable surrounded with <pre> tag.
* @param object $var the variable to dump
* @param boolean $die wether to die() after printing the output
* @return null
*/
function d($var, $exit = false) {
echo "<pre dir='ltr'>";
ob_start();
if(is_array($var)) {
@AmmarCodes
AmmarCodes / datepicker.css
Created November 6, 2013 14:05
Date picker library for Bootstrap v3 Edited from http://www.eyecon.ro/bootstrap-datepicker/ to work with Bootstrap v3
/*!
* Datepicker for Bootstrap
*
* Copyright 2012 Stefan Petre
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
.datepicker {
top: 0;
@AmmarCodes
AmmarCodes / get-latest-videos.js
Last active March 20, 2019 17:17 — forked from douglasmiranda/get-latest-videos.js
Get the latest videos from a YouTube channel with jQuery.
function show_my_videos(data){
html = ['<ul id="videos">'];
$(data.data.items).each(function(item) {
id = item.id;
description = item.title;
html.push('<iframe width="560" height="315" src="//www.youtube.com/embed/'+ id +'" frameborder="0" allowfullscreen></iframe>');
});
$("#videos").html(html.join(''));
}
// Replace [YOUTUBE_CHANNEL] with the channel you want
To enable any of there plugins, go to: `Settings` -> `Plugins`
You'll find plugins in the first page, to get the others press `Browse repositories...` button.
- Apache config (.htaccess) support
- Bootstrap
- Color Ide
- CSS Support
- EditorConfig
- File Watchers
- Git Integration
@AmmarCodes
AmmarCodes / functions.php
Last active August 29, 2015 14:05
WordPress: Add Google News Sitemaps using WordPress SEO, for more explanation check the blog post: https://aalakkad.github.io/blog/wordpress-add-google-news-sitemaps/
<?php
//////////////////////////////////////////////////////////////////////////////////
// Google News Sitemap //
// //
// Refer to: https://aalakkad.github.io/blog/wordpress-add-google-news-sitemaps //
//////////////////////////////////////////////////////////////////////////////////
// Check for WPSEO_Sitemaps class from WordPress SEO plugin
if(class_exists('WPSEO_Sitemaps')) {
add_action('init', 'my_custom_google_news_sitemap');