Skip to content

Instantly share code, notes, and snippets.

@diversen
diversen / drupal-curl-install-script
Created Apr 5, 2010
drupal curl install script
View drupal-curl-install-script
<?php
/**
* playing around with curl. Here is an example of using curl for installing drupal
* without using the browser
*
* Just change different settings and run
* php drupal-curl.php
*
* Script will produce html for all urls visited. To collect the result use:
@diversen
diversen / emusic php client
Created Sep 18, 2010
emusic client for php
View emusic php client
#!/usr/bin/php
<?php
/**
* Small script for downloading music from emusic.com
* I have had troubles before using the client. So
* I made this small script which does the same as a
* java client on 8MB.
*
* Script will creates folders for artists and folders
View gist:6cce9060e8780952fc661471b65d3193
Du har magt over dit sind - ikke ydre hændelser. Indse dette, og du vil finde styrke.
Marcus Aurelius, Meditationer
View CosCMS multi dir backup
#!/usr/bin/env php
<?php
// Backup all sites in folder
// Extract back - remember -p flag in tar command
function getSites () {
$test = "/datadrive/www/event.smartpub.dk";
$real = "/datadrive/www/*";
@diversen
diversen / phar-composer-usage-example.md
Last active Dec 31, 2016
notes about phar-composer
View phar-composer-usage-example.md

phar-composer example

Create a composer dir called pgit

Create a composer.json file inside this dir containing:

{
    "require": {
        "diversen/minimal-cli-framework": "^1.1"
@diversen
diversen / jockey-full-of-bourbon.txt
Created Jan 9, 2017
jockey-full-of-bourbon-chords
View jockey-full-of-bourbon.txt
Jockey full of burbon
Tom Waits from the album 'rain dogs'
[Verse]
Am
Edna Millon in a drop dead suit
E7
View Caseys-Last-Ride-Chords.txt
[Verse 1]
Am G
Casey joins the hollow sound of silent people walking down
F E
The stairway to the subway in the shadows down below
Am G
Following their footsteps through the neon darkened corridors
F E
Of silent desperation,never speaking to a soul
View townes-van-zandt-lungs-chords.txt
[Verse 1]
Em
Wont you lend your lungs to me
D Em
Mine are collapsing
Em
Plant my feet and bitterly
D Em
Breathe up the time that's passing
View allow-url-fopen-composer.sh
#!/bin/sh
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
php -d allow_url_fopen=1 -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
@diversen
diversen / Fejlkoder fra ePay´s betalingsgateway.txt
Created May 15, 2017
Fejlkoder fra ePay´s betalingsgateway
View Fejlkoder fra ePay´s betalingsgateway.txt
Fejlkode Beskrivelse af fejlkode
-10006 Afbrudt
-5604 Gebyret kan ikke udregnes for den anvendte korttype.
-5603 Butikken tillader ikke den anvendte korttype/betalingskort
-5602 Der er anvendt en ugyldig valutakode.
-5601 Gebyret kan ikke udregnes for den anvendte korttype.
-5600 Kortnummeret er ikke angivet korrekt - ugyldigt prefix (skal være på 6 tegn).
-5514 Kundens session er enten udløbet, eller også er betalingen ikke startet korrekt.
-5511 Der er opstået en fejl! Start forfra med din betaling.
-5509 Du får fejlen Not valid data, når du prøver at åbne Standard Betalingsvinduet. Du får denne fejl, fordi ePay ikke kan finde dataene til transaktionen. Denne fejl opstår, fordi brugeren/kunden har været inaktivt i over 20 minutter!