Skip to content

Instantly share code, notes, and snippets.

View bhu1st's full-sized avatar
🎯
Focusing

bhu1st bhu1st

🎯
Focusing
View GitHub Profile
@bhu1st
bhu1st / okta_curl.php
Last active August 24, 2017 17:10
OKTA API Call with PHP Curl
/**********************************
Function for OKTA REST API CALL
***********************************/
function Okta ($url, $method = "GET", $data = "") {
$apiKey = "your key";
$baseUrl = "https://dev-123456.oktapreview.com";
$headers = array(
/*
1. WAF to calculate Factorial
2. Calculate factorial Recursively
3. WAF factorial (number, true);
4. Improve/optimize the function
*/
#include <iostream>
using namespace std;
<?php
// This is the text editor interface.
// Anything you type or change here will be seen by the other person in real time.
// You are given tasks which can be identified as A, B, ...
// Execution of eack task takes tA, tB, ... time
// If you execute task A, you have to wait dA time before executing task A again
// If you are given a sequence of tasks and asked to execute sequentially, how long would it take to execute them?
//
// A B C A A D B
@bhu1st
bhu1st / sentencecount.java
Created November 27, 2015 21:09
Sentence Count
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/
@bhu1st
bhu1st / problem.txt
Last active December 2, 2015 10:53
Pi pi
The first 12 digits of pi are 314159265358. We can make these digits into an
expression evaluating to 27182 (first 5 digits of e) as follows:
3141 * 5 / 9 * 26 / 5 * 3 - 5 * 8 = 27182
or
3 + 1 - 415 * 92 + 65358 = 27182
Notice that the order of the input digits is not changed.
@bhu1st
bhu1st / word-frequency-count.php
Created September 16, 2015 03:23
Word Frequency Count
<?php
/*
URL: http://stackoverflow.com/questions/3169051/code-golf-word-frequency-chart
Credit for this code goes to the author, refer the discussion in stackoverflow.
*/
$filename = "largefile.txt";
/* get content of $filename in $content */
@bhu1st
bhu1st / blogger-basic-template
Created July 29, 2013 15:34
Basic: Blogger Template for Designers & Developers Absolutely Minimum
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<b:include data='blog' name='all-head-content'/>
<link expr:href='data:blog.url' rel='canonical'/>
<b:if cond='data:blog.pageType == &quot;index&quot;'>
<title><data:blog.pageTitle/></title>
@bhu1st
bhu1st / PandaChaser.java
Created July 29, 2012 07:54
AndEngine Accelerometer added to Panda Chaser
/*
Talking about this:
https://github.com/reittes/AndEngine-Training-All-Codes/issues/1
*/
package com.semicolon.pandachaser;
import java.io.IOException;
import javax.microedition.khronos.opengles.GL10;
body {
font: 11px/1.5em "Lucida Grande";
}
h1, h2, h3, h4, h5, h6 {
font-family: helvetica, arial, verdana, sans-serif;
font-weight: normal;
}
h1 {