Skip to content

Instantly share code, notes, and snippets.

View dharmastyle's full-sized avatar

Dharma Ferrari dharmastyle

View GitHub Profile
#!/usr/bin/env php
<?php
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
<?php
define('WP_USE_THEMES', false);
require( dirname(__FILE__) . '/wp-load.php' );
/**
* Return WPML defined language codes
* @return Array
*/
/**
* Return available client language choosen from $availableLanguages array
*/
function getClientLanguage($availableLanguages = null, $default='en'){
// Keeps BC and looks for embedded function instead of pass a parameter
$availableLanguages = $availableLanguages ?: getAvailableLanguages();
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$langs=explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
//start going through each one

Keybase proof

I hereby claim:

  • I am dharmastyle on github.
  • I am dharmaferrari (https://keybase.io/dharmaferrari) on keybase.
  • I have a public key whose fingerprint is 5843 4103 E4E8 450A C602 EE32 FBCF 561E EE1A CEA2

To claim this, I am signing this object:

$window.bind('resize load', function(){
if(this.isResizing) clearTimeout(this.isResizing);
this.isResizing = setTimeout(function() {
// do stuff..
}, 500);
});
<?php
/**
* sfWidgetFormChoiceAutocomplete represents a multiple select displayed as an autocomplete input and a list of checkboxes.
*
*
* @package symfony
* @subpackage widget
* @author Gerald Estadieu <gestadieu@usj.edu.mo>
* @version
*/
<?php
$string = "1234567890";
$n = 3;
$numberOfCarachter = strlen($string);
$newStringArray = array();
$stringInitialPosition = 0;
echo "Number of Character: ".$numberOfCarachter."\n";
while($stringInitialPosition < $numberOfCarachter){