Skip to content

Instantly share code, notes, and snippets.

View cocotopia's full-sized avatar

George Dueñas cocotopia

  • cocotopia
  • peru
View GitHub Profile
@cocotopia
cocotopia / Mac OS X: Open in Visual Studio Code
Created July 10, 2018 20:58 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@cocotopia
cocotopia / ipinfo.js
Created March 23, 2018 20:31 — forked from netsi1964/ipinfo.js
Vanilla javascript XHR request to ipinfo.io
function ipinfo(cb, ip) {
var request;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
request = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
try {
request = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try {
request = new ActiveXObject('Microsoft.XMLHTTP');