Skip to content

Instantly share code, notes, and snippets.

View Jeff-Lewis's full-sized avatar

Jeff Lewis Jeff-Lewis

  • StreetConnect & SchoolBee
  • NYC
View GitHub Profile
// originaly from https://kb.apify.com/tips-and-tricks/scraping-data-from-websites-using-schemaorg-microdata
function schemaOrgParser() {
var extractValue = function(elem) {
return $(elem).attr("content") || $(elem).text()
|| $(elem).attr("src") || $(elem).attr("href") || null;
};
var addProperty = function(item,propName,value) {
if( typeof(value)==='string' )
value = value.trim();
if( Array.isArray(item[propName]) )
@Jeff-Lewis
Jeff-Lewis / chromium-bookmark-folders.patch
Created September 26, 2018 17:57 — forked from gg7/chromium-bookmark-folders.patch
Increase the number of recently shown folders (5) in chromium when adding/modifying a bookmark
diff --git a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
index 88df062..5adbc2e 100644
--- a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
+++ b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
@@ -14,7 +14,7 @@
namespace {
// Max number of most recently used folders.
-const size_t kMaxMRUFolders = 5;
+const size_t kMaxMRUFolders = 20;
@Jeff-Lewis
Jeff-Lewis / update_npm_global.bat
Created April 21, 2018 14:53
Install (update) npm -global on Windows when using nvm-windows
@REM https://github.com/coreybutler/nvm-windows/issues/300
pushd %ProgramFiles%\nodejs
del npm npm.cmd
move node_modules\npm node_modules\npm2
node node_modules\npm2\bin\npm-cli.js i npm@latest -g
rd node_modules\npm2 /S /Q
popd
const fs = require('fs');
const async_hooks = require('async_hooks');
let indent = 0;
async_hooks.createHook({
init(asyncId, type, triggerAsyncId) {
const eid = async_hooks.executionAsyncId();
const indentStr = ' '.repeat(indent);
fs.writeSync(
1,
@Jeff-Lewis
Jeff-Lewis / Install-ChocoAndScoop.ps1
Created March 5, 2018 00:21 — forked from turboBasic/Install-ChocoAndScoop.ps1
Install Chocolatey and Scoop package managers for Windows + basic set of utilities and software
Function Install-Scoop {
New-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" `
-propertyType ExpandString `
-name "SCOOP_GLOBAL" `
-value "${ENV:PROGRAMDATA}\scoop"
Invoke-WebRequest 'https://get.scoop.sh' | Invoke-Expression
'scoop install Git-with-OpenSSH Sudo Which --global' | Set-Content -path temp_script.ps1
@Jeff-Lewis
Jeff-Lewis / howtomagic.ipynb
Created August 15, 2017 21:33 — forked from AustinRochford/howtomagic.ipynb
How to Write a Jupyter Magic
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@Jeff-Lewis
Jeff-Lewis / Export-Excel.ps1
Created May 30, 2017 03:35 — forked from josheinstein/Export-Excel.ps1
A better way to pipe PowerShell output to an Excel spreadsheet with some basic support for formatting and much, much faster than using COM automation to populate the cells.
#.SYNOPSIS
# Exports objects to an Excel spreadsheet by writing them to a temporary
# CSV file and using Excel automation model to import it into a workbook.
# This allows formatting to be applied to columns which would not otherwise
# be possible in a plain CSV export.
function Export-Excel {
[CmdletBinding()]
param(
param (
[ValidateNotNullOrEmpty()]
[string] $ScriptPath,
[ValidateNotNullOrEmpty()]
[string] $TaskName
# Pass in as many arguments as you want....
)
# Setup error handling.
Trap
.
├── matree
├── swift
│   ├── 00503_0_254.242_2013mar02
│   ├── 00546_0_ensbdasa-09aug2013
│   ├── 00553_0_ensbdpix3-09aug2013
│   ├── 00554_0_ensbdpix4-09aug2013
│   ├── 00555_0_ensbdrtr1-2013aug09
│   ├── 00557_0_ENSBDVPN1-02AUG2013
│   ├── 00558_0_ENSBDVPN2-02AUG2013