Skip to content

Instantly share code, notes, and snippets.

Ash ashbeats

Block or report user

Report or block ashbeats

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View max_occuring_char_in_string.js
let seed = 'baa##a11111111^^11bbb';
function first_max_occurring_character_in_string(text) {
let m = text.match(/[a-zA-Z0-9]/gi),
c = m.map(s => m.filter(y => y === s).length);
return m[c.indexOf(Math.max(...c))];
}
console.log(
View max_occuring_alphanumeric_character_in_string.php
<?php
/**
* Author: git@ashbeats
* Date: 6/12/2019
* Time: 10:46 PM
*/
$testCases = [
'123Adggaaabaaaaaaabbc' => 'a',
'aaabbb' => 'a', // a
View ContiguousSearch.php
<?php
/**
* Author: git@ashbeats
* Date: 12/2/2018
* Time: 2:45 AM
*/
/**
* Late night code after stumbling on https://youtu.be/IWvbPIYQPFM?t=537 and a ton of beers.
View gist:2601b99c76bf6fa8070f87cba42a47e9
#
# REQUIRES:
# - server (the forge server instance)
# - site_name (the name of the site folder)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - event_id (the provisioning event name)
# - callback (the callback URL)
#
View label_image_naive.php
<?php
/***
This script runs a local image against the image labeler.
~/tensorflow/bazel-bin/tensorflow/examples/label_image/label_image \
--graph=$graph_model --labels=$labels \
--output_layer=final_result \
--image=$image_path
Make sure you build 'label_image' first and copy it + the models into this folder.
@ashbeats
ashbeats / Css2ImagikConverter.php
Last active Jun 22, 2018
// wrote this to create templates faster using psd's as guides.// this class helps me to convert psd css into imagik style positioning values// supports angle, top(y), left(x), fontsize (takes lineheight into consideration and adds the needed padding to the top)
View Css2ImagikConverter.php
<?php
/**
* Created by PhpStorm.
* User: Ash64bit
* Date: 29-Jul-16
* Time: 9:38 PM
*/
namespace App\CustomLibs\JohnChristos\Vidx;
View VixCompiler.php
<?php
/**
*
* @param array $paths_media_inputs
* @param string $paths_media_output
* @param int $default_video_stream_index
* @param int $default_audio_stream_index
* @return string
*/
View unicode-tests.php
<?php
/**
* Created by PhpStorm.
* User: Ash (ashbeats@gmail.com)
* Date: 23-Apr-16
* Time: 4:31 PM
*/
// வார்த்தைகள்
/* வார்த்தைகள் */
@ashbeats
ashbeats / tam-consonant.php
Last active Jun 22, 2018
Simple-unicode-zoom-test
View tam-consonant.php
<?php
function tamil_consonant()
{
$consonants = [
["Sound" => "AK", "hex" => "0B83", "text" => ""],
["Sound" => "KA", "hex" => "0B95", "text" => ""],
["Sound" => "NGA", "hex" => "0B99", "text" => ""],
["Sound" => "CA", "hex" => "0B9A", "text" => ""],
You can’t perform that action at this time.