Skip to content

Instantly share code, notes, and snippets.

View alispx's full-sized avatar

ALI MAHFUD alispx

View GitHub Profile
#!/bin/bash
ssh -T username@hostorip << EOSSH
cd /home/username/; ls -l;
wget -c http://example.com/file.tar.gz;
tar -zxvf file.tar.gz;
exit;
EOSSH
#!/bin/bash
find . -type d -iname .git | xargs rm -rf
find . -type d -iname .sass-cache | xargs rm -rf
find . -type f -iname .gitignore | xargs rm -rf
find . -type f -iname .DS_Store | xargs rm -rf
find . -type f -iname config.codekit | xargs rm -rf
find . -type f -iname screen.css.map | xargs rm -rf
find . -type f -iname rtl.css.map | xargs rm -rf
find . -type f -iname config.rb | xargs rm -rf
find . -type d -iname sass | xargs rm -rf
<?php
/**
* Get all type posts
*
* @return void
* @author alispx
**/
function alispx_get_type_posts_data( $post_type = 'post' ) {
@alispx
alispx / instagram-scrapper.php
Created June 30, 2015 02:02
Instagram scrapper
// based on https://gist.github.com/cosmocatalano/4544576
function scrape_instagram( $username, $slice = 9 ) {
$username = strtolower( $username );
if ( false === ( $instagram = get_transient( 'instagram-media-new-'.sanitize_title_with_dashes( $username ) ) ) ) {
$remote = wp_remote_get( 'http://instagram.com/'.trim( $username ) );
if ( is_wp_error( $remote ) )
@alispx
alispx / layers-widget-template.php
Last active August 29, 2015 14:21
Template Layers Widget
<?php
/**
* Template Widget
*
* This file is used to register and display the Layers - Your widget Name.
*
* @package Layers
* @since Layers 1.0
*/
@alispx
alispx / Kamus-layers.php
Created May 26, 2015 21:55
Kamus Layers Widget
// Design Bar
$this->design_bar(
'side', // CSS Class Name
array(
'name' => $this->get_field_name( 'design' ),
'id' => $this->get_field_id( 'design' ),
), // Widget Object
$instance, // Widget Values
array(
'layout',
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
<?php
/*
Template Name: Update Network
*/
get_header();
if ( is_user_logged_in() ) {
function _remove_script_version( $src ){
$parts = explode( '?', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
<link rel='stylesheet' id='style' href='http://local.wordpress.dev/alispx/wp-content/themes/highwind/style.css?ver=1.0' type='text/css' media='all' />
<script type='text/javascript' src='http://local.wordpress.dev/alispx/wp-includes/js/jquery/jquery.js?ver=1.11.1'></script>