Skip to content

Instantly share code, notes, and snippets.

@DiogoDoreto
DiogoDoreto / yarn-lock-check.js
Last active April 18, 2022 03:39
Log dependencies that are potentially duplicated in yarn.lock
const readline = require('readline');
const fs = require('fs');
const file = fs.createReadStream('yarn.lock');
const rl = readline.createInterface(file);
let lastPkg, lastVer, lastLine, currPkg, currVer, currLine;
const re = /^"?(@?[^@]+)/;
rl.on('line', (line) => {
@DiogoDoreto
DiogoDoreto / keymap.cson
Last active April 11, 2016 11:51
My Atom Configuration
# Stop emmet from hijacking tab from snippets and autocomplete
# https://github.com/atom/autocomplete-plus/issues/86#issuecomment-82661027
'atom-text-editor.autocomplete-active:not([mini])':
'tab': 'autocomplete-plus:confirm'
# Stop emmet from hijacking tab from snippet tab stops
# https://github.com/atom/autocomplete-plus/issues/86#issuecomment-82661027
'atom-text-editor[data-grammar="text html basic"]:not([mini]), atom-text-editor[data-grammar~="jade"]:not([mini]), atom-text-editor[data-grammar~="css"]:not([mini]), atom-text-editor[data-grammar~="sass"]:not([mini])':
'tab': 'snippets:next-tab-stop'
@DiogoDoreto
DiogoDoreto / gist:d1101664963cc5ac05f3
Created March 6, 2015 13:27
Bootable Windows Pendrive
Enter these commands on a privileged command prompt in exact order:
diskpart
list disk (***then look for your flash drive***)
select disk N (***where N is your flash drive's number. e.g. select disk 2**)
clean
create partition primary
select partition 1
active
format fs=fat32 quick
@DiogoDoreto
DiogoDoreto / XSLT 1.0
Created July 3, 2013 17:13
Distinct values in XSLT 1.0
<xsl:key name="product" match="/items/item/products/product/text()" use="." />
<xsl:template match="/">
<xsl:for-each select="/items/item/products/product/text()[generate-id()
= generate-id(key('product',.)[1])]">
<li>
<xsl:value-of select="."/>
</li>
</xsl:for-each>
@DiogoDoreto
DiogoDoreto / Preferences.sublime-settings
Last active October 10, 2015 00:37
My Sublime Text 2 Settings
{
"auto_complete_commit_on_tab": true,
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_face": "Droid Sans Mono Dotted",
"font_options":
[
"subpixel_antialias"
],