Skip to content

Instantly share code, notes, and snippets.

View guioconnor's full-sized avatar
🦎

Guilherme Zühlke O'Connor guioconnor

🦎
  • London, UK
View GitHub Profile
@jordanbtucker
jordanbtucker / json5.pegjs
Last active March 17, 2024 11:14
PEG.JS file for JSON5
/*
MIT License
Copyright (c) 2019 Jordan Tucker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@WesSouza
WesSouza / zeit-now-g-suite-setup.md
Last active March 27, 2019 18:23 — forked from jaydenseric/zeit-now-g-suite-setup.md
Zeit Now G Suite setup

Run each of the following lines, replacing yourdomain.com and AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA with your details:

export NOW_DOMAIN=yourdomain.com
export GOOGLE_VERIFICATION=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
now dns add "$NOW_DOMAIN" @ TXT "google-site-verification=$GOOGLE_VERIFICATION"
now dns add "$NOW_DOMAIN" @ MX ASPMX.L.GOOGLE.COM 1
now dns add "$NOW_DOMAIN" @ MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add "$NOW_DOMAIN" @ MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add "$NOW_DOMAIN" @ MX ALT3.ASPMX.L.GOOGLE.COM 10
@kentwait
kentwait / mount_vbox_shared_boot.md
Last active November 14, 2023 11:22
Mount VirtualBox shared folder on boot using fstab

How to mount a VirtualBox shared folder when the Guest OS boots

Problem

While using VirtualBox's Guest Additions to mount shared folders provides a seamless way to mount shared folders, there are also disadvantages.

  • Shared folders will always mount in /media/sf_(share name) unless specified using through vbox drivers in the guest OS
  • Mounting does not happen at boot-time. Applications that require paths at boot will not be able to access the shared folder even after it is mounted - such as Docker.

Solution

Instead of relying on Guest Additions, if you have sudo permissions, shared folders can be mounted at boot-time using fstab. Using this approach allows

@Yimiprod
Yimiprod / difference.js
Last active April 5, 2024 13:17
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@tgrrtt
tgrrtt / travis.yml
Last active January 10, 2021 17:58
Travis-CI Config File (.travis.yml)
# Set up notification options
notifications:
email:
recipients:
- one@example.com
- other@example.com
# change is when the repo status goes from pass to fail or vice versa
on_success: change
on_failure: always
@jcgregorio
jcgregorio / How_to_use.html
Last active July 17, 2023 14:44
HTML Templating using the HTML <template> element and exactly 100 lines of JS. A cleaned up version of this code is now available at https://github.com/jcgregorio/stamp/.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src="templating.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<template id=t>
@umaar
umaar / webdriver-hover.js
Created February 17, 2014 14:05
Hover over an element in WebDriverJS
/*
* Hover over an element on the page
*/
(function() {
"use strict";
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().usingServer().withCapabilities({'browserName': 'chrome' }).build();

Virtual DOM and diffing algorithm

There was a [great article][1] about how react implements it's virtual DOM. There are some really interesting ideas in there but they are deeply buried in the implementation of the React framework.

However, it's possible to implement just the virtual DOM and diff algorithm on it's own as a set of independent modules.

@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n