Skip to content

Instantly share code, notes, and snippets.

View ahmadawais's full-sized avatar
Building the LLM computing primitive at Langbase.com

Ahmad Awais ⌘ ahmadawais

Building the LLM computing primitive at Langbase.com
View GitHub Profile
@zanematthew
zanematthew / welcome.php
Created December 12, 2014 17:27
Note this is a snippet from a class, you can replace the $this-> with your params or hardcode them. Its all ran during admin_init.
<?php
/**
* Sends user to the start page on first activation, as well as each time the
* plugin is upgraded to a new version
*
* @access public
* @since 1.1
* @return void
*/
<div class="form-horizontal">
<div class="form-group"><label class="control-label col-md-3">Full Name</label><div class="col-md-9">[text* your-name class:form-control]</div></div>
<div class="form-group"><label class="control-label col-md-3">Email Address</label><div class="col-md-9">[email* your-email class:form-control]</div></div>
<div class="form-group"><label class="control-label col-md-3">Subject</label><div class="col-md-9">[text your-subject class:form-control]</div></div>
<div class="form-group"><label class="control-label col-md-3">Message</label><div class="col-md-9">[textarea your-message x5 class:form-control]</div></div>
<div class="form-group"><div class="col-md-offset-3 col-md-9">[submit class:btn class:btn-primary "Send"]</div></div>
</div>
anonymous
anonymous / my.css
Created December 29, 2014 20:22
CSS Gradient Animation
background: linear-gradient(270deg, #5b318c, #000000);
background-size: 400% 400%;
-webkit-animation: AnimationName 10s ease infinite;
-moz-animation: AnimationName 10s ease infinite;
-o-animation: AnimationName 10s ease infinite;
animation: AnimationName 10s ease infinite;
@-webkit-keyframes AnimationName {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
@bearded-avenger
bearded-avenger / social.php
Last active August 29, 2015 14:16
dead-simple-social-shit-4000-super-duper-beards-with-goats.php
<?php
/**
*
* This class holds all teh functionality for social sharing and social data so you dont need a plugin
* Ex: https://lasso.is/now-entering-the-arena/ (bottom)
*
* use social sharing like so:
* <a href="#" class="post-share__twitter">share twitter</a>
* <a href="#" class="post-share__fb">share fb</a>
@rosswd
rosswd / hacks.md
Last active October 22, 2015 14:31
HTML, JS, DOM, CSS Hacks
@rorymcdaniel
rorymcdaniel / loop-multisite.sh
Created December 16, 2015 01:48
Bash script that will regenerate all images for all sites in a WordPress multisite network
#!/bin/bash
for site in `wp site list --field=url`; do
wp media regenerate --yes --url=$site
done
~
// Custom Dashboard widgets
function custom_dashboard_widgets() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] );
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] );
@pixline
pixline / .scrutinizer.yml
Created September 28, 2013 17:22
sample scrutinizer.yml config file for WordPress plugin
filter:
paths:
- 'lib/*'
- '/*'
excluded_paths:
- 'tests/*'
- 'examples/*'
tools:
php_mess_detector:
filter:
@raideus
raideus / wp-admin-menu-reorder.php
Created July 16, 2012 13:33
Re-order WordPress Admin menu items
<?php
/**
* Re-orders tabs in the WordPress Admin menu. Include this in the functions.php file of your theme.
*/
function gs_custom_menu_order($menu_ord) {
if (!$menu_ord) return true;
return array(
'index.php',
<?php
/**
* Plugin Name: Deprecated admin_notices
* Description: Disable PHP Deprecated notices and display in admin_notices
* Author: Weston Ruter, XWP
*/
call_user_func( function() {
error_reporting( error_reporting() ^ E_DEPRECATED );