Skip to content

Instantly share code, notes, and snippets.

<?php
//php streaming proxy
header('Access-Control: allow <*>'); //xdomain ajax ftw
set_time_limit(24*3600);
$fp = fsockopen("192.168.1.149", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
@xeoncross
xeoncross / ajax.js
Last active August 3, 2023 06:06
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
/**
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object
*
* @param string url
* @param object callback
* @param mixed data
* @param null x
*/
function ajax(url, callback, data, x) {
try {
@pbojinov
pbojinov / checkmark.html
Created August 25, 2015 21:27
extracting sweet alert success checkmark
<!-- <div class="sa-icon sa-success" style="display: block;">
<span class="sa-line sa-tip"></span>
<span class="sa-line sa-long"></span>
<div class="sa-placeholder"></div>
<div class="sa-fix"></div>
</div> -->
<!-- <div class="sa-icon sa-success animate" style="display: block;">
<span class="sa-line sa-tip animateSuccessTip"></span>
@paslandau
paslandau / isDirtyFix.php
Last active September 18, 2018 22:31
Dirty fix for Model::isDirty() in Laravel to honor the $casts attribute
<?php
/**
* Determine if the model or given attribute(s) have been modified.
*
* @param Model $m
* @param array|string|null $attributes
* @return bool
*/
function _is_dirty(Model $m, $attributes = null){