Skip to content

Instantly share code, notes, and snippets.

@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"],
$('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: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;
@Lasha
Lasha / .gitconfig
Created October 17, 2012 04:57 — forked from buzzedword/.gitconfig
Public Global .gitconfig
[user]
name = John Doe
email = user@email.place
[color]
ui = true
status = auto
branch = auto
[alias]
st = status
@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 / 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
$(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 / 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++) {
@Lasha
Lasha / jQuery_bitlyfi.js
Created July 28, 2012 05:07 — forked from qwertypants/jQuery_bitlyfi.js
Create a bit.ly URL by passing the URL you want shortened and preforming a function with it
function bitlyfi(url, func) {
// Put your own login and apiKey
var defaults = {
login: '',
apiKey: '',
longUrl: url
};
// Build the URL to query
var bitly = "http://api.bit.ly/v3/shorten?" + "&login=" + defaults.login + "&apiKey=" + defaults.apiKey + "&longUrl=" + defaults.longUrl + "&format=json&callback=?";
@Lasha
Lasha / piracy.js
Created June 22, 2012 15:46 — forked from buzzedword/piracy.js
Downloading Calvin & Hobbs
// On http://imgur.com/a/EYCTw
// Open Console
var downloadString = '';
$('.image-hover.download a').each(function(i){
downloadString += 'echo "Downloading '+ (i+1) + '.jpg..."\n\r';
downloadString += 'curl -L http://www.imgur.com' + $(this).attr('href') +' -o '+ (i+1) + '.jpg\n\r';
downloadString += 'echo "Finished! Waiting 3 seconds before continuing..."\n\r';
downloadString += 'echo \n\r';
downloadString += 'sleep 3 \n\r';