Skip to content

Instantly share code, notes, and snippets.

@Lasha
Lasha / gist:3339977
Created August 13, 2012 11:57
Crazy DOM manipulation, store and parse old data, remove it, and append newly formatted to parent containers
$('.warfarin-box-right').each(function(index, element) {
$(this).find('p').each(function(i,el) {
var $currentParent = $(this).parent();
var medProp = $(el).html().split(':');
var medPropName = $('<span />', { "class" : "medPropLeft", text: medProp[0] + ":" });
var medPropDesc = $('<p />',
{ "class" : "medPropRight",
html: (function() {
var textToOutput = "";
for (var i = 0; i < medProp.length; i++) {
$(function() {
var uploadFileNames = '&';
$("#file_upload").uploadify({
'swf': '/uploadify/uploadify.swf',
'uploader': '/uploadify/uploadify.php',
'onUploadSuccess': function(file, data, response) {
alert('The file ' + file.name + ' was successfully uploaded with a response of ' + response + ':' + data);
uploadFileNames += 'fileNames[]=' + file.name + '&';
},
'onQueueComplete': function(queueData) {
@Lasha
Lasha / Bash crap.sh
Created October 17, 2012 00:53 — forked from buzzedword/Bash crap.sh
Initial setups
# Xcode
open http://itunes.apple.com/us/app/xcode/id497799835?mt=12
# Homebrew
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
# Git
brew install git
# Git Flow
@Lasha
Lasha / Bash crap.sh
Created October 17, 2012 04:51 — forked from buzzedword/Bash crap.sh
Initial setups
# Xcode
open http://itunes.apple.com/us/app/xcode/id497799835?mt=12
# Homebrew
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
# Git
brew install git
# Git Flow
@Lasha
Lasha / .gitconfig
Created October 17, 2012 04:57 — forked from buzzedword/.gitconfig
Public Global .gitconfig
[user]
name = John Doe
email = [email protected]
[color]
ui = true
status = auto
branch = auto
[alias]
st = status
@Lasha
Lasha / gist:4511021
Created January 11, 2013 14:26
Self invoking function after initial trigger, utilizing setTimeouts
var activeCounter = 0,
$acitivityMsgs = $('.progress-bar').find('.message'),
$activeMsg = $acitivityMsgs.filter('.active'),
totalMessages = $acitivityMsgs.length,
activityTimer = 5000;
function activityAdvance(){
if (activeCounter < totalMessages-1){
$activeMsg = $activeMsg.fadeOut('slow').removeClass('active').next().fadeIn('fast').addClass('active');
// activeCounter = $activeMsg.index('.message') + 1;
$('input[placeholder]').each(function()
{
var input = $(this);
$(input).val(input.attr('placeholder')).addClass('placeheld');
$(input).focus(function() {
if (input.val() == input.attr('placeholder'))
input.val('').removeClass('placeheld');
});
@Lasha
Lasha / gist:10afa56085ec3b8d89f4
Created June 19, 2015 19:29
Sublime Text – key mapping – toggle retina antialiasing
{
"keys": ["ctrl+alt+t"],
"command": "set_setting",
"args": {
"setting": "font_options",
"value": ["gray_antialias"]
}
},
{
"keys": ["ctrl+alt+shift+t"],