Skip to content

Instantly share code, notes, and snippets.

Sergio Vilar sergiovilar

Block or report user

Report or block sergiovilar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sergiovilar
sergiovilar / CamelCase.js
Created Mar 14, 2014
Check if a string is Camel Case using Javascript
View CamelCase.js
String.prototype.toCamelCase = function(cap1st) {
'use strict';
return ((cap1st ? '-' : '') + this).replace(/-+([^-])/g, function(a, b) {
return b.toUpperCase();
});
};
function isCamelCase(str){
'use strict';
@sergiovilar
sergiovilar / valorPorExtenso.js
Last active Mar 20, 2019
Transcrição de valores por extenso em Javascript
View valorPorExtenso.js
// Define as partes do valor por extenso
var extenso = [];
extenso[1] = 'um';
extenso[2] = 'dois';
extenso[3] = 'tres';
extenso[4] = 'quatro';
extenso[5] = 'cinco';
extenso[6] = 'seis';
extenso[7] = 'sete';
View keybase.md

Keybase proof

I hereby claim:

  • I am sergiovilar on github.
  • I am svilar (https://keybase.io/svilar) on keybase.
  • I have a public key ASCQQ_XGqnv3iKNFhklDIXeNnRbaq00zTszSU9XFl2wtGAo

To claim this, I am signing this object:

View cookie-clicker-cheat.js
@sergiovilar
sergiovilar / index.js
Last active Apr 1, 2018
Script para baixar livros do site http://lelivros.li/
View index.js
/*
* lelivros
* user/repo
*
* Copyright (c) 2014 Sérgio Vilar
* Licensed under the MIT license.
*/
'use strict';
@sergiovilar
sergiovilar / init.js
Created Oct 2, 2017
Translate DVORAK hotkeys to QWERTY in Atom
View init.js
atom.keymaps.addKeystrokeResolver(({keystroke, event}) => {
var qKeys = "q w e r t y u i o p [ ] a s d f g h j k l ; ' z x c v b n m , . /".split(' ')
, dvorakKeys = "' , . p y f g c r l / = a o e u i d h t n s - ; q j k x b m w v z".split(' ')
, key = keystroke
, replaced = [];
if(event.type == 'keydown' && event.metaKey && event.key !== 'Meta' && keystroke.startsWith('cmd-')) {
for(var i in dvorakKeys) {
@sergiovilar
sergiovilar / pkg.js
Created Sep 15, 2015
Package Electron applications
View pkg.js
#!/usr/bin/env node
var os = require('os');
var pkgjson = require('./package.json');
var path = require('path');
var sh = require('shelljs');
var appVersion = pkgjson.version
, electronPackager = 'electron-packager'
, electronVersion = '0.29.2'
View gist:8652718
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://b2click.com/" />
<title>New Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
View gist:8598086
var treeData = [
{title: "item1 with key and tooltip", tooltip: "Look, a tool tip!" },
{title: "item2: selected on init", selected: true },
{title: "Folder", isFolder: true, key: "id3",
children: [
{title: "Sub-item 3.1",
children: [
{title: "Sub-item 3.1.1", key: "id3.1.1" },
{title: "Sub-item 3.1.2", key: "id3.1.2" }
]
View gist:8288220
#('#campo1').change(function(){
if($(this).val() == 'VALOR'){
$('#campo2').show();
}
});
You can’t perform that action at this time.