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
.selector, .selector-secondary, .selector[type=text] {
padding:15px;
margin:0px 0px 15px;
background-color:rgba(0, 0, 0, 0.5);
box-shadow:0px 1px 2px #CCC,inset 0 1px 0 #FFFFFF
}
.selector,
.selector-secondary,
.selector[type="text"] {
padding: 15px;
margin-bottom: 15px;
background-color: rgba(0,0,0,.5);
box-shadow: 0 1px 2px #ccc, inset 0 1px 0 #fff;
}
#!/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"
@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]
*/
@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>
// 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();
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"> \
[
{ "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" },
@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}