Skip to content

Instantly share code, notes, and snippets.

module Main where
x = 32
<?php
function mins($mins) {
$mins = (int)$mins;
$day = 1440;
$hour = 60;
if($mins<$hour) {
if($mins==0) {
<?php
$html = '<p><a class="lol">HELLO</a><a class="wat">lolololol</a></p><a class="lol">drink shit</a>';
$doc = new DOMDocument();
$file = @$doc->loadHTML($html);
$xp = new DOMXpath($doc);
foreach($xp->query('//*[contains(@class, \'lol\')]', $doc) as $found) {
echo "{$found->nodeValue}\n";
}
$html = '<p><a class="lol">HELLO</a><a class="wat">lolololol</a></p><a class="lol">drink shit</a>';
$doc = new DOMDocument();
$file = @$doc->loadHTML($html);
$xp = new DOMXpath($doc);
foreach($xp->query('//*[contains(@class, \'lol\')]', $doc) as $found) {
echo "{$found->nodeValue}\n";
}
@codigazo
codigazo / gist:804173
Created January 31, 2011 15:20
Drupal form auto-fill scripts
// Node edit. Pathauto.
jQuery('#edit-pathauto-perform-alias').attr('checked', true);
jQuery('#edit-submit').click();
<?xml version="1.0" encoding="UTF-8" ?>
<!-- $Id: schema.xml,v 1.1.2.1.2.38 2010/07/01 02:42:07 pwolanin Exp $ -->
<!--
This is the Solr schema file. This file should be named "schema.xml" and
should be in the conf directory under the solr home
(i.e. ./solr/conf/schema.xml by default)
or located where the classloader for the Solr webapp can find it.
For more information, on how to customize this file, please see
array (
0 => 'panels_layout_link',
1 => 'panels_layout_icon',
2 => 'panels_pane',
3 => 'panels_common_content_list',
4 => 'panels_render_display_form',
5 => 'panels_dashboard',
6 => 'panels_dashboard_link',
7 => 'panels_dashboard_block',
8 => 'panels_flexible',
string 'Array
(
[0] => panels_layout_link
[1] => panels_layout_icon
[2] => panels_pane
[3] => panels_common_content_list
[4] => panels_render_display_form
[5] => panels_dashboard
[6] => panels_dashboard_link
[7] => panels_dashboard_block
var generarPuntos = function() {
var puntos = [];
for (var i = 0; i < 20; i++) {
puntos.push({
marker: {longitud: 323, latitud: 32},
descripcion: "lorem ipsum",
comentarios: [{fecha: "432432", email: "da", comentarioUsuario: "lorem ipsum"}],
imgPath: "/foo/bar"
});
}
var DRUIDE = DRUIDE || {
// Properties: State
canvas: null,
pageX: 0,
pageY: 0,
editingState: {editing: false},
mouseState: {currentTool: {name: 'default'}},
// Properties: Selectors
canvasSelector: '#designer-canvas-container',
debugScreenSelector: '#designer-debug-screen',