This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const type2scope = (type) => type.replace('SET', '').toLowerCase(); | |
const setLocal = (ctx, ev) => { | |
const scope = type2scope(ev.type); | |
ctx.scope = scope; | |
ctx.country = ['country', 'region', 'local'].includes(scope); | |
ctx.region = ['region', 'local'].includes(scope); | |
ctx.city = ['local'].includes(scope); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface TaxContext { | |
auto: boolean, | |
city: boolean, | |
country: boolean, | |
exemptShow: boolean, | |
originShow: boolean, | |
provider: boolean, | |
providerValues: { | |
avalara: boolean, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
const foxyEncryptionKey = 'YOUR_ENCRYPTION_KEY_HERE'; | |
const foxyStoreId = 'YOUR_STORE_ID_HERE'; | |
const foxyStoreDomain = 'YOUR_STORE_DOMAIN_HERE'; | |
const http = require('http'); | |
const server = http.createServer(handleRequest); | |
const routes = { | |
'transaction/created': handleTransactionCreated, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo sysctl -w fs.inotify.max_user_watches=100000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mymodule_preprocess_page(&$variables) { | |
if (isset($variables['node']) && $variables['node']->type == 'book') { | |
// Add js | |
drupal_add_js(drupal_get_path('module', 'mymodule') . '/mymodule.awesome.js'); | |
$variables['scripts'] = drupal_get_js(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
primeiro=$1; | |
segundo=$2; | |
for linha in $(cat $primeiro); do | |
if ! [[ $(grep "^$linha$" $segundo) ]]; then | |
echo "$primeiro não está contido em $segundo"; | |
exit 1; | |
fi; | |
done; | |
exit 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mapleader = " " | |
set backupdir=.backup/,~/.backup/,/tmp// | |
set directory=.swp/,~/.swp/,/tmp// | |
set undodir=.undo/,~/.undo/,/tmp// | |
set undofile | |
packloadall " Load all plugins. | |
silent! helptags ALL " Load help files for all plugins. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("Initializing mySearch"); | |
var filter=document.getElementById('myfilter') | |
buildForm(filter, filterTable) | |
function filterTable(){ | |
this.table.setAttribute('id', 'deu-certo') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim $(newbug) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
hoje=`date +%Y-%m-%d` | |
LAST=$(find . -maxdepth 1 -name $hoje-"*.bug" -type f -printf "%p\n" | sed -e s/.\\/$hoje-//g -e s/.bug//g | sort -g | tail -1) | |
echo $hoje-$(($LAST + 1)).bug |
NewerOlder