Skip to content

Instantly share code, notes, and snippets.

View ooooak's full-sized avatar
🏠
Working from home

Akshay ooooak

🏠
Working from home
View GitHub Profile
@ooooak
ooooak / new_file0
Created July 31, 2015 07:39
[wordpress] add description Max Mega Menu
<?php
add_filter('megamenu_walker_nav_menu_start_el', function($item_output, $item, $depth, $args){
if (!empty($item->description))
{
$item_output .= "<span class='menu-description'>{$item->description}</span>";
}
return $item_output;
@ooooak
ooooak / gist:5a8121b38cb1868e377d
Last active August 29, 2015 14:25
[ocaml] Read file from stdin
let source =
let code = ref "" in
try
while true do
code := !code ^ input_line stdin
done;
!code
with
End_of_file -> !code
@ooooak
ooooak / serv.c
Last active August 29, 2015 14:24
[c] Win sock api
#include<stdio.h>
#include<winsock2.h>
#include<process.h>
// Winsock Library
#pragma comment(lib, "ws2_32.lib")
unsigned int __stdcall handle_client(void *data);
void err(const char *text);
@ooooak
ooooak / gist:3d6f6c291d946ddfc1f7
Last active August 29, 2015 14:22
[wordpress] [buddypress] get list of Groups
<?php
$data = array();
$groups = BP_Groups_Group::get(array(
'type'=>'alphabetical',
'per_page'=>999
));
foreach ($groups as $group)
{
$data['name'][] = array(
@ooooak
ooooak / gist:115dda2f5d38b27da075
Created May 6, 2015 10:15
revolution: stop video on next slide
(function(){
if (typeof revapi2 === 'undefined'){
return;
}
revapi2.bind("revolution.slide.onloaded",function (e,data) {
revapi2.bind("revolution.slide.onchange",function (e,data) {
var iframes = $('.rev_slider > ul > li iframe');
$('.rev_slider > ul > li iframe').each(function(index, el) {
@ooooak
ooooak / gist:d05d3d2396ab59b1c498
Last active August 29, 2015 14:20
[php] curl make get request
<?php
function get($url){
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
// CURLOPT_USERAGENT => 'Codular Sample cURL Request'
@ooooak
ooooak / gist:8fc138363a0f65afa056
Last active August 29, 2015 14:18
[counter-strike]: Global Offensive: Cross hair styles
--------------------
user: WarOwl
color: custom
size: medium
--------------------
cl_crosshairstyle 4;
cl_crosshairdot 0;
cl_crosshairusealpha 1;
cl_crosshairalpha 200;
cl_crosshaircolor 5;
@ooooak
ooooak / gist:0604fde32d0f721df79a
Last active August 29, 2015 14:12
[php] skype smiles script
<?php
define('offset', 8);
define('icon_count', 8);
$loop = range(0, 22); // too lazy
$icon = [':)',':(',':D','8=)',';)',':o',';(','(sweat)',':|',':*',':P','(yn)','(blush)',':^)','|-)','|(','(inlove)',']:)','(yawn)','(puke)','(doh)',':@','(wasntme)','(party)','(facepalm)',':S','(mm)','8-|',':x','(hi)','(devil)','(angel)','(envy)','(wait)','(bear)','(makeup)','(giggle)','(clap)','(think)','(bow)','(rofl)','(whew)','(happy)','(smirk)','(nod)','(shake)','(emo)','(y)','(n)','(handshake)','(h)','(tmi)','(heidy)','(f)','(rain)','(sun)','(music)','(coffee)','(pizza)','(cash)','(muscle)','(^)','(beer)','(d)','(dance)','(ninja)','(*)','(tumbleweed)','(bandit)'];
function add_space( $int ){
$val = 0;
while ($int >= $val) {
var mymodule=angular.module('myApp', []);
mymodule.controller('Testing', function Testing($scope,$http){
$http.get('http://graph.facebook.com/627043117349800/photos/')
.success( function(data,status){
var images=[];
$.each(data.data, function(index, value){
console.log(value.images[0]);
@ooooak
ooooak / gist:be84af6f4f3f76d5847e
Created December 5, 2014 10:37
change spam status
if (!function_exists('update_user_status')){
include(ABSPATH . "wp-admin/includes/ms.php");
}
if (!update_user_status($user_id, 'spam', $spam_value)){
return array(true, 'Unable to change spam status');
}