Skip to content

Instantly share code, notes, and snippets.

View shankarcabus's full-sized avatar
💭
Hello world :)

Shankar Cabus shankarcabus

💭
Hello world :)
View GitHub Profile
@shankarcabus
shankarcabus / Preferences.sublime-settings.json
Last active December 17, 2015 21:09
My User Settings of Sublime Text 3
{
"auto_complete": true,
"caret_style": "phase",
"close_windows_when_empty": false,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
"fold_buttons": false,
"folder_exclude_patterns":
[
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
/** MIT License
*
* KeySpline - use bezier curve for transition easing function
* Copyright (c) 2012 Gaetan Renaudeau <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
@shankarcabus
shankarcabus / checkall.js
Created June 18, 2013 01:54
Check all in Facebook event
checkboxes=document.getElementsByName("checkableitems[]");for(var i=0,n=checkboxes.length;i<n;i++){checkboxes[i].checked=true}
[
{ "keys": ["super+`"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
{ "keys": ["super+shift+o"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
{ "keys": ["super+shift+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["super+3"], "command": "find_under_expand" },
{ "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
{ "keys": ["super+b"], "command": "toggle_side_bar" },
{ "keys": ["super+ctrl+b"], "command": "build" },
var dialog = document.createElement('div'),
ie6Launch = 2001,
ie7Launch = 2006,
currentYear = new Date().getFullYear(),
ieVersion = head.browser.version,
timeAgo = ieVersion <= 6 ? currentYear - ie6Launch : currentYear - ie7Launch;
dialog.className = 'dialog-fixed browsers';
dialog.innerHTML = '\
<div class="out-box"> \
// how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
// how could this code be rewritten in order to remove the if?
if (foo) {
bar.doSomething();
// how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
// how could this code be rewritten in order to remove the if?
if (foo) {
bar.doSomething();
@shankarcabus
shankarcabus / upload.html
Last active December 26, 2015 18:39
Upload image with crop
<div class="add-offer-field-image">
<div class="add-offer-upload-image">
<input class="add-offer-field-file" type="file" name="image">
Adicionar imagem<i class="icon-picture"></i>
</div>
<div class="add-offer-image-preview">
<img src="" alt="">
</div>
</div>
@shankarcabus
shankarcabus / jquery.autoresize.js
Created November 5, 2013 17:21
Textarea autoresize
/*
* jQuery autoresize 0.1
* http://jusbrasil.com
* Copyright 2013
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
* @author: [email protected]
*/
#!/bin/bash
echo "Restarting VirtualBox"
sudo /Library/StartupItems/VirtualBox/VirtualBox restart
echo "Starting vagrant [lb, webnode, testsuite]"
cd ~/git/jusbrasil-webpy/resources
vagrant halt -f; vagrant up
echo "Activating virtualenv"