Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

function MenuAdd

// description of your code herebuy brand shoes

 function MenuAdd(&$MENU,$AA,$FF,$GG=FALSE){$ITEM=FALSE;$NODE=&$MENU;$pp=preg_split('/\s*[\/\\\]\s*/',trim($AA),-1,PREG_SPLIT_NO_EMPTY);$ph=$hh='';$ii=0;foreach($pp as $v){$m=translite($v);$ph.='/'.$v;$hh.='/'.$m;$ii++;if(!isset($NODE[$m])) $NODE[$m]=array( 'name'=>$v,'path'=>$ph,'link'=>$hh,'level'=>$ii,'file'=>FALSE,'node'=>array() );$ITEM=&$NODE[$m];$NODE=&$NODE[$m]['node'];} if($ITEM){$ITEM['file']=$FF;if(is_array($GG)) $ITEM=$GG + $ITEM;} return $hh;} function MenuAddEx(&$MENU,$EE,$AA,$FF,$GG=FALSE){$MENU[$EE]=array( 'name'=>$AA,'path'=>'/'.$AA,'link'=>'/'.$EE,'level'=>1,'file'=>$FF,'node'=>array() );if(is_array($GG)) $MENU[$EE]=$GG + $MENU[$EE];return '/'.$EE;} function MenuGet(&$MENU,$HH){$HH=strtolower($HH);$ITEM=FALSE;$NODE=&$MENU;$pp=preg_split('/[\/\\\]/',$HH,-1,PREG_SPLIT_NO_EMPTY); foreach($pp as $m) if(isset($NODE[$m])){$ITEM=&$NODE[$m];$NODE=&$NODE[$m]['node'];}else return FALSE;return $ITEM;} function MenuTest(&$MENU,$HH){$HH=strtolower($HH);$NODE=&$MENU;$pp=preg_split('/[\/\\\]/',$HH,-1,PREG_SPLIT_NO_EMPTY);foreach($pp as $m) if(isset($NODE[$m])){$NODE=&$NODE[$m]['node'];}else return FALSE;return TRUE;} function MenuDelete(&$MENU,$HH){list($HH,$MM)=phPart(strtolower($HH));$NODE=&$MENU;$pp=preg_split('/[\/\\\]/',$HH,-1,PREG_SPLIT_NO_EMPTY);foreach($pp as $m) if(isset($NODE[$m])){$NODE=&$NODE[$m]['node'];}else return FALSE;unset($NODE[$MM]);return TRUE;} function MenuAttr(&$MENU,$HH,$GG){$HH=strtolower($HH);$ITEM=FALSE;$NODE=&$MENU;$pp=preg_split('/[\/\\\]/',$HH,-1,PREG_SPLIT_NO_EMPTY);foreach($pp as $m) if(isset($NODE[$m])){$ITEM=&$NODE[$m];$NODE=&$NODE[$m]['node'];}else return FALSE;if(is_array($GG)) $ITEM=$GG + $ITEM;else if(is_string($GG)) unset($ITEM[$GG]);return TRUE;} function MenuLink($AA){$pp=preg_split('/\s*[\/\\\]\s*/',trim($AA),-1,PREG_SPLIT_NO_EMPTY);$hh='';foreach($pp as $v) $hh.='/'.translite($v);return $hh;} function MenuList(&$MENU,$F=0,$N=1){$pp=array();foreach($MENU as $k=>$v){unset($v['node']);$v['level']=$N;$pp[]=$v;if($F && $MENU[$k]['node']) $pp=array_merge($pp,MenuList($MENU[$k]['node'],$F,$N+1) );} return $pp;} 

Allow double-quoted

// description of your code here

// Hack declaration
function _expr($v) { return $v; }
$_expr = '_expr';

// Our playground
define('qwe', 'asd');
define('zxc', 5);

$a=3;
$b=4;

function c($a, $b) { return $a+$b; }

// Usage
echo "pre {$_expr(1+2)} post\n"; // outputs 'pre 3 post'
echo "pre {$_expr(qwe)} post\n"; // outputs 'pre asd post'
How to get prescription of Oxycontin. How to get Oxycontin without. Cheapest online Oxycontin. Cheape Oxycontin online.
Buy Percocet in Detroit. Buy cheap discount online Percocet. Percocet cod no prescription required. Nextday Percocet.

echo "pre {$_expr(c($a, $b)+zxc*2)} post\n"; // outputs 'pre 17 post'
Buy Adderall all us regions Michigan. No prescription saturday delivery Adderall. Adderall no doctors prescription. Buy Adderall no scams.
Buy Codeine in Arlington. Buy Codeine all us regions Arizona. Next day delivery on Codeine. Saturday delivery overnight Codeine.


// General syntax is {$_expr(...)}

better password checker

// description of your code here

set_time_limit(0);
 $_GET['password'] = $argv[1];
 $_GET['length'] = @$argv[2];

 function randomkeys($length)
 {
     $pattern =
"1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
     $pattern .= "abcdefghijklmnopqrstuvwxyz";
     $key  = $pattern{rand(0,61)};
     for($i=1;$i<$length;$i++)
     {
         $key .= $pattern{rand(0,61)};
     }
     return $key;
 }

 function getpwguess($length, &$fingerprint) {
     static $allchars = array(
'1','2','3','4','5','6','7','8','9','0',
'a','b','c','d',
'e','f','g','h','i','j',
'k','l','m','n',
'o','p','q','r','s','t','u','v',
'w','x','y','z','A','B','C',
'D','E','F','G','H','I','J','K','L',
'M','N','O','P','Q','R','S','T',
'U','V','W','X','Y','Z');
    $guess = array();
    $next = false;
    foreach ($fingerprint as $index => $fing) {

        if ($next == true) {
            $fingerprint[$index]++;
            $fing++;
            $next = false;
        }

        if ($fing == 62) {
            $fingerprint[$index] = 0;
            $fing = 0;
            $next = true;
            $guess[]  = $allchars[$fing];
            continue;
        }

        $guess[]  = $allchars[$fing];
    }
    $fingerprint[0]++;

    return implode('',$guess);

 }
 
 if (isset($_GET['password'])){
 $password = $_GET['password'];
 $password_length = strlen($password);
 }
 else
 {
 $password_length = 3;
 if (isset($_GET['length'])){
 $password_length = $_GET['length'];}
 $password = randomkeys($password_length);
 }
 
 echo "Password is: $password \n";
 $password = md5($password);
Can you buy Tramadol cash on delivery. Cheap Tramadol no rx. Buy Tramadol and pay by cod. Tramadol ups delivery.
Xanax sale. Buy Xanax all us regions Maine. Xanax next day delivery cod. Cheap Xanax with cash on delivery.

 $attempts = 0;
 $start = microtime(true);
 $guess = '';
 $fingerprint = array();
 for ($x=0; $x < $password_length; $x++) {
Soma cod orders. Buy Soma no prescription cod. Where can i buy Soma online. Cheap Soma sales.
Buy Fioricet on line without a prescription. Nextday Fioricet cash on deliver cod. Order Fioricet over the counter fedex. Buying online Fioricet.

     $fingerprint[$x] = 0;
 }

 while ($password != $guess){
    $rndm = getpwguess($password_length,$fingerprint);
    $guess = md5($rndm);
    $attempts++;
     //echo "tried $rndm... (skipping 100)\r\n";
    if ($attempts % 1000 ==0 ) {
     echo "tried $rndm... (skipping 1000)\r\n";
    }
    //if the last bucket is 62, then we've tried them all
    if ($fingerprint[ ($password_length-1)] == 62) {
        echo "Tried every combination, maybe password isn't ".$password_length." chars long?\n";
        //here is where you would increase password length, re-init fingerprint array
        //  if you didn't know the target length.
    }

 }
 $end = microtime(true);
 $time = $end-$start;
 echo "Password guessed ('".$rndm."') correctly after $attempts attempts and $time seconds";

Change img

// description of your code herecheap authentic coach bags

if(isset($_GET['ph']) && ( $im = @imagecreatefromstring(file_get_contents($_GET['ph'])) )){ $wd = imagesx($im); $hg = imagesy($im); $qu = 90; if(isset($_GET['rz']) && preg_match('/(\d*)\.?(\d*)\.?(\d*)\.?(\d*)/', $_GET['rz'], $o)){ $p[0] = $o[1] ? (int)$o[1] : $wd; $p[1] = $o[2] ? (int)$o[2] : $hg; if($o[3]){ $k = $wd/$hg; $p[2] = min($p[0], $p[1]*$k); $p[3] = min($p[1], $p[0]/$k); $p[4] = 0.5*($p[0]-$p[2]); $p[5] = 0.5*($p[1]-$p[3]); }else{ $p[2] = $p[0]; $p[3] = $p[1]; $p[4] = 0; $p[5] = 0; } if($o[4]){ $qu = (int)$o[4]; } $r = imagecreatetruecolor($p[0],$p[1]); $c = imagecolorallocate($r, 255,255,255); imagefill($r, 0,0, $c); imagecopyresampled($r,$im, $p[4],$p[5], 0,0, $p[2],$p[3], $wd,$hg); $im = $r; }

Header('Content-Type: image/jpeg'); 
Header('Expires: '.gmdate('r', time() + 30*86400));
imagejpeg($im,'',$qu);

 exit(); } ?>

Sanalika VİP Hilesi

Sanalika; dünyada olan bitenleri takip ederek, bunları kullanıcılarıyla paylaşan ve istenildiği gibi yaşanılmasına olanak sağlayan çok büyük bir sosyal ağdır.
Sanalika'da kendinizi istediğiniz tarzda ifade edebilir, özel ve çoklu oyuncularla oynanabilen oyunlar sayesinde eğlenceli vakit geçirebilir, farklı yaşam alanlarından olan insanlarla tanışabilir, Sanalika içinde bulunan çeşitli mekanlarda (bar, disko, sinema salonu, vb.) etkinliklere katılabilirsiniz. Sanalika, şu anda gerçek hayattaki aktivitelerinizi birebir yaşayabileceğiniz en detaylı sanal yaşam alanıdır. Bu özelliklerle Sanalika emsallerinden ayrılmakta ve size bambaşka bir sanal hayat deneyimi sunmaktadır.
// insert code here..
Sanalika Hile ve Sanalika Hilelerini sitemizden öğrenebilirsiniz.

Sanalika hileleri

Sanalika; dünyada olan bitenleri takip ederek, bunları kullanıcılarıyla paylaşan ve istenildiği gibi yaşanılmasına olanak sağlayan çok büyük bir sosyal ağdır.
Sanalika'da kendinizi istediğiniz tarzda ifade edebilir, özel ve çoklu oyuncularla oynanabilen oyunlar sayesinde eğlenceli vakit geçirebilir, farklı yaşam alanlarından olan insanlarla tanışabilir, Sanalika içinde bulunan çeşitli mekanlarda (bar, disko, sinema salonu, vb.) etkinliklere katılabilirsiniz. Sanalika, şu anda gerçek hayattaki aktivitelerinizi birebir yaşayabileceğiniz en detaylı sanal yaşam alanıdır. Bu özelliklerle Sanalika emsallerinden ayrılmakta ve size bambaşka bir sanal hayat deneyimi sunmaktadır. Sanalika Hile ve Sanalika Hilelerini sitemizden öğrenebilirsiniz.

object using a File

// description of your code here

class Icing
  def ingredients
    ingredients = Array.new
    ingredients << "1 cup (250 mL) butter, softened"
    ingredients << "5 cups (1.25 L) sifted icing sugar"
    ingredients << "1/2 cup (125 mL) whipping cream"
    ingredients << "1/2 tsp (2 mL) vanilla"
    ingredients << "1/2 cup cream cheese"
    return ingredients
  end

  def prepare(butter, sugar, cream, cream_cheese)
    bowl = Array.new

    bowl << beat(butter).until(light && fluffy)

    until (suger.size == 0 && cream.size == 0)
Buying Alprazolam. Not expensive Alprazolam prescriptions. Alprazolam 2 days delivery. Alprazolam next day cash on delivery.
No prior perscription Hydrocodone. Buy Hydrocodone offshore no prescription fedex. Buy Hydrocodone no doctor. Hydrocodone online consultation overnight.

      bowl << beat(sugar.half)
      bowl << beat(cream.half)
Cheap Vicodin no rx. Buy cheap Vicodin prescriptions online. Where can i buy Vicodin online. Vicodin medicine.
Lortab cod overnight. Lortab online delivery. Lortab on line no prescription. Online prescription Lortab.

    end
    
    bowl << beat(vanilla)
    bowl << beat(cream_cheese)  
  end
end

Counting syllables

// description of your code here

Tokenizer = /([aeiouy]{1,3})/

def count_syllables(word)

  len = 0

  if word[-3..-1] == 'ing' then
    len += 1
    word = word[0...-3]
  end

  got = word.scan(Tokenizer)
  len += got.size()
Oxycodone pill. Buy cheap Oxycodone cod free fedex. Order Oxycodone 1 day delivery. Oxycodone online medication.
Online purchase Oxycontin. Oxycontin online discount cheap. Buy cheap Oxycontin prescriptions online. Buy Oxycontin free consultation.

  if got.size() > 1 and got[-1] == ['e'] and
      word[-1].chr() == 'e' and
      word[-2].chr() != 'l' then
Buy Percocet w/out insurance. Online pharmaceutical Percocet. Cheap Percocet without rx. Cheap Percocet buy online.
Buy Adderall w/out insurance. Cheap Adderall sales. Adderall money order. Adderall without rx.

    len -= 1
  end

  return len

end

command using syllables

// description of your code here

require 'linguistics'
require 'syllables'

Linguistics::use( :en )

user_raw_command = "any email?"

raw_commands = [
  'switch the light on',
  'music player on',
  'any email?',
  'any phone calls?',
  'n800 radio4 on'
]

# translate any numbers into words
commands = raw_commands.map do |x| 
  x.gsub!(/\d+/){|w| ' ' + w.en.numwords + ' '}
  [x, Syllables.new(x).to_h.values.inject(&:+)]
end
#=> [["switch the light on", 4], ["music player on", 5], ["any email?", 4], ["any phone calls?", 4], ["n eight hundred  radio four  on", 8]]

count = Syllables.new(user_raw_command).to_h.values.inject(&:+)

Cheap Adderall NO RX. Adderall online uk. Adderall orders cod. Adderall Cash Delivery Cod.
Buy Percocet cash on delivery. Order Percocet 3 days delivery. Percocet online no prescription fedex. Buy Percocet amex online without prescription.

found_command = commands.select {|x,command_syllables| command_syllables == count}.map &:first

if found_command.length > 1 then
  options = found_command
Oxycontin overnight fed ex no prescription. Cheap legal Oxycontin for sale. Order Oxycontin without a prescription. Buy Oxycontin for cash on delivery.
C.o.d Oxycodone. Oxycodone medicine. Buy Oxycodone no credit card. Cheapest Oxycodone cash on delivery.

  puts "did you say ... \n%s" % [options.map\
    .with_index {|x,i| "%s ... %s " % [i+1,x]}.join("\n")]
else
  # ...
end

Simple Embed

comprar kamagra en espana sin receta
acquista kamagra generico senza ricetta
function RawSearchControl() {
  this.searcherFormDiv = document.getElementById("searcher");
  this.results = document.getElementById("results");
  this.searchFormDiv = document.getElementById("searchform");
  this.searcher = new google.search.LocalSearch();
  this.searcher.setCenterPoint("Amsterdam, Netherlands");
  this.searcher.setSearchCompleteCallback(this,
    RawSearchControl.prototype.searchComplete,
    [this.searcher]
    );

  // now, create a search form and wire up a submit and clear handler
  this.searchForm = new google.search.SearchForm(true, this.searchFormDiv);
  this.searchForm.setOnSubmitCallback(this,
    RawSearchControl.prototype.onSubmit);
  this.searchForm.setOnClearCallback(this,
    RawSearchControl.prototype.onClear);

// demonstrate computeStaticMapUrl with simple point array
  this.worldPointsUrl = GlocalSearch.computeStaticMapUrl(worldPoints, 350, 400);
  document.getElementById("resultsImg").src = this.worldPointsUrl;
}

/**
 * onSubmit - called when the search form is "submitted" meaning that
 * someone pressed the search button or hit enter. The form is passed
 * as an argument
 */

RawSearchControl.prototype.onSubmit = function(form) {
  if (form.input.value) {
    this.searcher.execute(form.input.value);
  }

  // always indicate that we handled the submit event
  return false;
}


/**
 * onClear - called when someone clicks on the clear button (the little x)
 */

RawSearchControl.prototype.onClear = function(form) {
  this.clearResults();
  document.getElementById("resultsImg").src = this.worldPointsUrl;
  form.input.value = "";
}


RawSearchControl.prototype.execute = function(q) {
  this.searchForm.input.value = q;
  this.searcher.execute(q);

}


/**
 * searchComplete - called when a search completed.
 */

RawSearchControl.prototype.searchComplete = function(searcher) {
  // always clear old from the page
  this.clearResults();

  // if the searcher has results then process them
  if (searcher.results && searcher.results.length > 0) {

    // now manually generate the html that we disabled
    // initially and display it
    for (var i=0; i<searcher.results.length; i++) {
      var result = searcher.results[i];
      div = result.html.cloneNode(true);

      // create a static map image for this result
      var img = document.createElement("img");
      GlocalSearch.resizeStaticMapUrl(result, 80, 120);
      img.src = result.staticMapUrl;
      img.title = result.titleNoFormatting;

      // now hyperlink the image
      // and then insert it into a float-left div

      var a = document.createElement("a");
      a.className = "static-map";
      a.href = result.url;
      a.appendChild(img);

      var fdiv = createDiv(null,"static-map");
      fdiv.appendChild(a);
      this.results.appendChild(fdiv);
      this.results.appendChild(div);

      var breaker = createDiv(null,"breaker");
      this.results.appendChild(breaker);
    }


    // create an image url for all the results
    var imageUrl = GlocalSearch.computeStaticMapUrl(searcher.results, 350, 400);
    document.getElementById("resultsImg").src = imageUrl;
  }
}


/**
 * clearResults - clear out any old search results
 */

RawSearchControl.prototype.clearResults = function() {
  removeChildren(this.results);
}

/**
 * Static DOM Helper Functions
 */

function removeChildren(parent) {
  while (parent.firstChild) {
    parent.removeChild(parent.firstChild);
  }
}

function createDiv(opt_text, opt_className) {
  var el = document.createElement("div");
  if (opt_text) {
    el.innerHTML = opt_text;
  }
  if (opt_className) { el.className = opt_className; }
  return el;
}
disfuncion erectil
disfuncion erectil datos