Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am cfg on github.
  • I am cfg (https://keybase.io/cfg) on keybase.
  • I have a public key whose fingerprint is 3208 1C5B 3FB2 1376 E3AD FFE5 F0C4 6E9F BC74 2B01

To claim this, I am signing this object:

@cfg
cfg / slack_emoji.js
Last active May 23, 2019 16:56
Crudely extract custom emoji from a Slack web instance. Load the web interface for the Slack instance and paste this into the developer console.
jQuery('#main_emo_menu').click();
jQuery('button[aria-label=Custom]').click();
jQuery('.p-emoji_picker__list').css('min-height', '900px');
jQuery('.p-emoji_picker__list_container').parents('.ReactModal__Content.ReactModal__Content--after-open.popover').css('top', '0px');
jQuery('.p-emoji_picker__list_container').css('max-height', '100%');
jQuery('.p-emoji_picker__content .p-emoji_picker__input_container').hide();
var emoji = [];
function parse_str(str, array) {
// discuss at: http://phpjs.org/functions/parse_str/
// original by: Cagri Ekin
// improved by: Michael White (http://getsprink.com)
// improved by: Jack
// improved by: Brett Zamir (http://brett-zamir.me)
// bugfixed by: Onno Marsman
// bugfixed by: Brett Zamir (http://brett-zamir.me)
// bugfixed by: stag019
// bugfixed by: Brett Zamir (http://brett-zamir.me)
@cfg
cfg / spotify-track-numbers.js
Created April 8, 2015 15:06
quickly add track numbers to a spotify web playlist
// add jquery to collection-app-spotify frame
jQuery('.tracklist-playlist tbody tr').each( function(ix, el) { var r = jQuery(el); r.find('.tl-cell.tl-save').html( r.index() + 1 ); } );
@cfg
cfg / vip-dns.js
Created January 30, 2015 21:41
Hack function to bulk import DNS on WP VIP
/**
* Paste this into the console on your /wp-admin/admin.php?page=domains page
* Make sure the 'Edit DNS' tab is selected
* Add entries using add_record( 'example.com', 'A', '127.0.0.1' );
* or add_record( 'example.com', 'MX', '10 mail.example.com' );
* MX records values should be the Priority<space>mailserver
*
*/
add_record = function( record, type, value ) {
var valid_types = {
@cfg
cfg / list_itunes_backups.php
Created January 14, 2015 18:40
Hack to enumerate all iTunes backups and write a CSV with the basic information for each backup.
#!/usr/local/bin/php
<?php
$plists = array(
'Manifest.plist' => array(
// ":Version",
":WasPasscodeSet",
":IsEncrypted",
":Date",
":Lockdown:ProductType",
@cfg
cfg / dyndns.js
Created June 17, 2014 19:23
Hack to dump a dyndns zone in pseudo-BIND format.
jQuery('#adv3 tr.notranslate').each( function( i, el ) {
el = jQuery( el );
dom = el.find('td').eq(0).text();
ttl = el.find('td').eq(1).find('input').val();
type = el.find('td').eq(2).text().trim();
val = el.find('td').eq(3).find('input').val();
console.log( "%s\t\t%s\tIN %s\t%s", dom, ttl, type, val );
});

For the record I don't agree with the actions evad3rs took, but I have a larger issue with your misleading article (https://blog.lookout.com/blog/2013/12/23/beware-geeks-bearing-gifts/).


Beware Geeks Bearing Gifts: How the Latest iPhone Jailbreak is Actually a Trojan

"Taig's branding is all over the Chinese version of the jailbreak in fact, so it should've been clear what's happening." http://www.reddit.com/r/jailbreak/comments/1tha74/letter_to_the_community/ce80hpa?context=3

"In cases where it's actually installed, we do inform the user, of course." http://www.reddit.com/r/jailbreak/comments/1tha74/letter_to_the_community/ce80exj?context=3

@cfg
cfg / staging-webook.php
Created August 28, 2013 23:06
Dirty code I use to push a clean branch to one of my dev servers. Use this to trigger the pull: git push origin --delete staging ; git push origin master:staging
<?php
$tracking_branch = 'refs/heads/staging';
$source_root = '/path/to/git/root';
if( empty($_POST['payload']) )
return;
$json = json_decode( $_POST['payload'], true );
<?php
function cfg_get_stack() {
$bt = debug_backtrace();
$stack = array();
array_shift($bt);
foreach( $bt as $item ) {
$str = '';
if( isset($item['file']) )
$str .= basename($item['file']);