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 / func.php
Created September 14, 2015 05:44
laravel bcrypt function
<?php
function bcrypt($password)
{
$hash = password_hash($password, PASSWORD_BCRYPT, ['cost' => 10]);
if ($hash === false)
{
throw new RuntimeException('Bcrypt hashing not supported.');
}
@ooooak
ooooak / play.rs
Last active September 14, 2015 04:30
#[derive(Debug)]
enum Lx {
Str(String),
Int(String),
Keyword(String),
LxUnk(char),
}
fn main() {
@ooooak
ooooak / style.css
Created August 21, 2015 07:20
[Bootstrap 3] form-group-vertical Class
.form-group-vertical .form-control:focus {
border-color: #cccccc;
outline: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.form-group-vertical .form-group {
margin-bottom: 0px;
}
.form-group-vertical .form-group input {
@ooooak
ooooak / gist:7778d5463974fa10f9d4
Created July 31, 2015 07:43
[unix]Get password from connected wifi connection linux
# first we need the SSID
iwconfig | grep "ESSID\|SSID"
# now run this
sudo cat /etc/NetworkManager/system-connections/YOUR_SSID | grep "psk="
Example
------------------
> iwconfig | grep "ESSID\|SSID"
@ooooak
ooooak / gist:9c079c6e53606d6d50a5
Created July 31, 2015 07:42
[wordpress] remove all schedules
//Add cron
function ffs(){
echo "string";
}
add_action('init', function(){
error_reporting(-1);
$events = array(
'admin_theme_wysija_hourly',
);
@ooooak
ooooak / gist:addea0aa1dfd137a81f6
Created July 31, 2015 07:42
form pop up html
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<style type="text/css">
.close{
color: #000;
float: right;
font-size: 21px;
@ooooak
ooooak / gist:89496820ba39f1332b91
Created July 31, 2015 07:42
[wordpress] all cron jobs name
foreach (_get_cron_array() as $timestamp => $_crons){
foreach ($_crons as $cron_name => $cron_args){
foreach ($cron_args as $cron) {
$crons[$cron['schedule']][] = $cron_name;
}
}
}
// 'wysija_hourlys'
// wp_clear_scheduled_hook('admin_theme_wysija_hourly');
@ooooak
ooooak / gist:b8d0969bd03c09b2a8d4
Created July 31, 2015 07:41
get current page wordpress
// get current page
global $pagenow;
@ooooak
ooooak / gist:91abbd1aba3c9b0d0ba8
Created July 31, 2015 07:41
create user in wordpress
$user = array(
'user_login' => admin_theme_user_manager::generate_username($username),
'user_pass' => wp_generate_password(5, false),
'user_email' => $subscriber['user_email'],
'first_name' => $subscriber['first_name'],
'last_name' => $subscriber['last_name'],
);
$user_id = wp_insert_user($user);
@ooooak
ooooak / function.php
Created July 31, 2015 07:39
remove search bar from admin bar
add_action( 'admin_bar_menu', function($wp_admin_bar){
$wp_admin_bar->remove_menu('search');
}, 10 );