Skip to content

Instantly share code, notes, and snippets.

<?php
$username = "_USERNAME_";
$password = "_PASSWORD_";
$sitename = ""; // blank for default
$URL = "_URL_";
////////////////
// Find Token (/api/2.0/auth/signin)
////////////////
<form action="" method="get">
<!-- search from -->
<div class="label">
<label for="suche.searchFrom">Tender from</label>
</div>
<div class="value">
<input id="suche.searchFrom" name="dato" value="10/03/2012" class="datepicker" type="text" />
</div>
<!-- produktart selection -->
<div class="label">
@PeterJuel
PeterJuel / gist:2634518
Created May 8, 2012 12:15
PHP: Import huge SQL file to MySQL
$mysqli = new mysqli('localhost', '#username', '#password', '#database');
$handle = fopen('sqldump.sql', 'rb');
if ($handle) {
while (!feof($handle)) {
// This assumes you don't have a row that is > 1MB (1000000)
// which is unlikely given the size of your DB
// Note that it has a DIRECT effect on your scripts memory
// usage.
$buffer = stream_get_line($handle, 1000000, ";\n");
@PeterJuel
PeterJuel / gist:2034331
Created March 14, 2012 05:38
SocialEngine: Colorbox submit buttons
// In the form
$this->addElement('Button', 'submit', array(
'label' => 'Tilbagetræk artikel',
'type' => 'submit',
'ignore' => true,
'decorators' => array('ViewHelper')
));
$this->addElement('Cancel', 'cancel', array(
'label' => 'cancel',
@PeterJuel
PeterJuel / gist:1989615
Created March 6, 2012 23:01
Jquery: Dom ready template
<script type="text/javascript">
$(document).ready(function(){
// Code here
});
</script>