Skip to content

Instantly share code, notes, and snippets.

View vincentntang's full-sized avatar
💭
¯\_(ツ)_/¯

Vincent Tang vincentntang

💭
¯\_(ツ)_/¯
View GitHub Profile
@planetoftheweb
planetoftheweb / tagline.coffee
Created May 8, 2014 16:39
Sample CoffeeScript files for my ultimate workflows course
do fill = (item = 'The most creative minds in Art') ->
$('.tagline').append "#{item}"
fill
@planetoftheweb
planetoftheweb / pixgrid.js
Created May 8, 2014 22:40
Lightbox that reads from a list of images with a class called pixgrid and then shows high res versions in a lightbox.
var pixgrid = function() {
function centerImage(theImage) {
var myDifX = (window.innerWidth - theImage.width) / 2, myDifY = (window.innerHeight - theImage.height) / 2;
return theImage.style.top = myDifY + "px", theImage.style.left = myDifX + "px",
theImage;
}
var myNodes = document.querySelectorAll(".pixgrid");
for (var i=0; i<myNodes.length; i++) {
myNodes[i].addEventListener("click", function(e) {
if ("IMG" === e.target.tagName) {
@planetoftheweb
planetoftheweb / rclick.js
Created May 8, 2014 22:42
Right click on images with a class of rclick to let you preview high res versions.
var rclick = function() {
var myNodes = document.querySelectorAll(".rclick");
for (var i=0; i<myNodes.length; i++) {
myNodes[i].addEventListener("contextmenu", function(e) {
e.preventDefault();
if (e.target.tagName === 'IMG') {
if (document.querySelector('.preview')== null) {
var myElement = document.createElement('div');
myElement.className = 'preview';
@planetoftheweb
planetoftheweb / data.json
Created May 8, 2014 23:20
data.json file for a list of speakers.
{ "speakers" : [
{
"name":"Mr Bellingham",
"shortname":"Barot_Bellingham",
"reknown":"Royal Academy of Painting and Sculpture",
"bio":"Barot has just finished his final year at The Royal Academy of Painting and Sculpture, where he excelled in glass etching paintings and portraiture. Hailed as one of the most diverse artists of his generation, Barot is equally as skilled with watercolors as he is with oils, and is just as well-balanced in different subject areas. Barot's collection entitled \"The Un-Collection\" will adorn the walls of Gilbert Hall, depicting his range of skills and sensibilities - all of them, uniquely Barot, yet undeniably different"
},
{
"name":"Jonathan G. Ferrar II",
"shortname":"Jonathan_Ferrar",
@planetoftheweb
planetoftheweb / sassfiles.scss
Last active February 23, 2020 11:52
Sass Files for my course on workflows
// style.scss
// ==============
//Compass imports
@import "compass";
@import "compass/css3/box-shadow";
//Core partials
@import "variables";
@import "mixins";
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active April 19, 2024 01:50
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@jojobyte
jojobyte / ContextCmder-Disable.reg
Last active October 5, 2023 13:13
Cmder Context (Right-Click) Menu for Windows 7, 8, 10 & 11
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@msrose
msrose / combining-git-repositories.md
Last active May 7, 2024 03:22
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@stefansundin
stefansundin / youtube-global-shortcuts.user.js
Last active May 5, 2022 17:27
Makes the YouTube shortcuts work even if the player is not focused. Install Greasemonkey/Tampermonkey first, then click [Raw] to install.
// ==UserScript==
// @name YouTube global shortcuts
// @namespace https://gist.github.com/stefansundin/
// @homepage https://gist.github.com/stefansundin/65e3d6db697636d8e7f1
// @downloadURL https://gist.github.com/stefansundin/65e3d6db697636d8e7f1/raw/youtube-global-shortcuts.user.js
// @version 1.1
// @author Stefan Sundin
// @description Makes the YouTube shortcuts work even if the player is not focused.
// @icon https://www.youtube.com/favicon.ico
// @match https://www.youtube.com/*
@tomhodgins
tomhodgins / snippets.md
Last active August 8, 2022 14:27
Snippets.md is my most often used HTML, CSS and JavaScript snippets for front-end web development