Skip to content

Instantly share code, notes, and snippets.

@jgv
jgv / screenshots
Created November 23, 2010 07:02
osx screenshots in a custom dir
defaults write com.apple.screencapture location ~/your/path
killall SystemUIServer
@jgv
jgv / gist:731093
Created December 6, 2010 22:22
js test for birthday party. pls fork.
partyTime = new Date(2010,12,11,23,30,0);
yrTime = new Date();
/// test for party
var checkForParty = function (yrTime, partyTime){
if (yrTime < partyTime) {
return false;
} else {
return true;
}
@jgv
jgv / crockford's lost joke
Created December 8, 2010 00:27
lost joke from javascript the good parts
var flight = {
airline: "Oceanic",
number: 815,
departure: {
IATA: "SYD",
time: "2004-09-22 14:55",
city: "Sydney"
},
arrival: {
IATA: "LAX",
@jgv
jgv / opacity.scss
Last active March 26, 2017 21:42
Cross-browser sass/scss mixin for opacity down to IE 5
@mixin hp-opacity($trans) {
filter: alpha(opactiy=($trans * 100));
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{$trans * 100})";
-moz-opacity: $trans;
-khtml-opacity: $trans;
opacity: $trans;
}
$("div.hp_main_object").hover(function(){
$(this).find(".hp_griddy_panel").addClass("on");
$(this).children(".hp_griddy_title").css({
"background" : "rgb(137,137,137)",
"cursor" : "pointer",
"color" : "rgb(255,255,255)"
});
if ( $(this).children("h5.hp_object_title") === true ) {
<div class="hp_main_object hover grid_2 alpha">
<div class="hp_griddy_price"><h5>$50</h5></div>
<div category="users" class="hp_griddy_img_wrap">
<a href="/users/19/profile"><img alt="Square" class="imgcontainer" height="140" src="http://s3.amazonaws.com/prestigedevelopment/jonathan_hp/thing_photos/19/square.jpg?1293060417" width="140" /></a>
</div>
<div class="hp_griddy_title">
<h5 class="hp_object_title">Couch </h5>
@jgv
jgv / functions
Created January 18, 2011 19:39
scss is the bestest. (need bleeding edge gem to make functions work)
/* @MIXINS */
@mixin rounded-corners($radius) {
border-radius: $radius;
-moz-border-radius: $radius;
-webkit-border-radius: $radius;
-khtml-border-radius: $radius;
}
@mixin rounded-top($side, $radius) {
_hoverLocation = $(".hp_hoverlocation");
// add focus styles for location form
_setLocationForm.focusin(
function() {
_setLocation.addClass("expose_form");
_protipArrow.addClass("protip_transparent");
_protip.addClass("protip_transparent");
_hoverCover.addClass("darkbody").css("height", $(document).height()).show();
console.log(_hoverLocation.length);
var width = document.width / 3;
var height = document.height / 3;
var i = 0;
cell = $("<div/>", {
"class" : "video",
"width" : width + "px",
"height" : height + "px",
"click" : function(e) {
e.preventDefault();
$table = '_emails';
$id = 'id_emails';
$emailColumn = 'email_addr;'
$query = sprintf("INSERT INTO `%s`.`%s` (`%s`,`%s`) VALUES (NULL, '%s')",
$dbname,
$table,
$id,
$emailColumn,
mysql_real_escape_string($email));