Skip to content

Instantly share code, notes, and snippets.

@rubenve
rubenve / hhvm-3.2-centos-plesk.txt
Last active May 8, 2018 06:20
Installing HHVM 3.2.0 on CentOS 6 with Plesk 11.5
# How to install the hhvm package using yum on CentOS 6.6 with Plesk 11.5
# Note that you can also install hhvm from source. For that check the official guides here:
# https://github.com/facebook/hhvm/wiki/Building-and-installing-HHVM-on-CentOS-6.6#13-install-ocaml
cd /etc/yum.repos.d
sudo wget http://www.hop5.in/yum/el6/hop5.repo
yum clean all
@iDavidMorales
iDavidMorales / Curl Shorte.St API
Created June 22, 2018 03:52
Curl Shorte.St API
<?php
function shst($url){
$apiurl="https://api.shorte.st/v1/data/url";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_URL, $apiurl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT' );
// Agregamos el Token que copiamos de la pagina.
curl_setopt($ch, CURLOPT_HTTPHEADER, array('public-api-token: XXXXXXXXXXXXXXXXXXX','X-HTTP-Method-Override: PUT'));
@ethnt
ethnt / Media.markdown
Created December 10, 2011 03:29
All of the media.

This is all the media that I would like, have but need to be converted to *.m4a or *.m4v, and holes in my collection. To see what I currently do have, look at Tree.txt.

In order to create the directory tree, use the following command in the Media directory.

ls -R | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/' > Tree.txt && mv Tree.txt .Manifest/

Music

  • Disney Parks — Disney's Electrical Parade
@Showfom
Showfom / unu-api-sample.php
Last active April 29, 2019 07:26
U.NU Sample Remote API Call
<?php
/*
* YOURLS : sample file showing how to use the API
* This shows how to tap into your YOURLS install API from *ANOTHER* server
* not from a file hosted on the same server. It's just a bit dumb to make a
* remote HTTP request to the server the request originates from.
*
* Rename to .php
*
@NicolasLoew
NicolasLoew / index.php
Created June 24, 2017 06:26 — forked from null-dev/index.php
1fichier.com direct link generator (PHP)
<?php
if(!isset($_GET['a'])) {
die('<form action="" method="get"><input type="text" name="a"/><input type="submit"/></form>');
}
$url = "https://1fichier.com/?" . urlencode($_GET['a']) . "?auth=1&inline";
stream_context_set_default(array(
'http' => array(
'method' => 'GET',
'header' => 'Authorization: Basic ' . '[BASE64 encoded login credentials. Format: "user:pass" (without quotes)]'
@HasStacey
HasStacey / JS Countdown timer with PHP variables
Last active August 16, 2020 08:30
Create a JS countdown timer driven by PHP variables
<?php
$year = 2014;
$month = 10;
$day = 21;
$hour = 14;
$min = 00;
$sec = 00;
$target = mktime($hour, $min, $sec, $month, $day, $year);
$current = time();
@lukapaunovic
lukapaunovic / Megatools CentOS install
Last active October 6, 2020 12:17
Megatools CentOS install
yum -y install gcc make glib2-devel libcurl-devel openssl-devel gmp-devel tar automake autoconf libtool wget asciidoc -y
wget https://megatools.megous.com/builds/megatools-1.10.0-rc1.tar.gz
tar -xzvf megatools*.tar.gz
cd megatools*
./configure
make
make install
@cmpscabral
cmpscabral / download.php
Last active April 11, 2021 22:39
on the fly zip stream download
<?php
//
// taken from http://stackoverflow.com/questions/4357073/on-the-fly-zipping-streaming-of-large-files-in-php-or-otherwise
//
// make sure to send all headers first
// Content-Type is the most important one (probably)
//
header('Content-Type: application/octet-stream');
header('Content-disposition: attachment; filename="file.zip"');
@theiostream
theiostream / CountryCode.h
Created June 26, 2013 21:15
Get a country code from Apple's StoreFront IDs.
// CountryCode.h
// (c) 2013 Bacon Coding Company, LLC.
// Licensed under the MIT License.
// I lost my time scripting this dictionary in Python than I'd have writing it.
// Regardless, it was some fun.
#import <Foundation/Foundation.h>
// Reference: http://www.apple.com/itunes/affiliates/resources/documentation/linking-to-the-itunes-music-store.html#appendix