Skip to content

Instantly share code, notes, and snippets.

View met's full-sized avatar
:octocat:

Martin Hassman met

:octocat:
View GitHub Profile
@greim
greim / tree.js
Created May 17, 2011 06:08
Nice ascii-art DOM trees
/**
tree.js - nice ascii-art DOM trees
usage: tree(element[, options]);
example:
var s = tree(document.body,{
serialize: function(element){...}, // return a string representation such as "div#foo.bar"
filter: function(element){...} // return false for any nodes to not include in tree
});
console.log(s);
*/
@joemccann
joemccann / javascript_will_listen.md
Created October 1, 2011 08:54
JavaScript Will Listen - By Bella Morningstar

I wouldn't be so alone

If my Github followers lived in my home

Alex Russell would send a pull request

But I'd be too busy

Return to San Francisco by nine

@tylerneylon
tylerneylon / copy.lua
Last active May 18, 2024 16:41
How to deep copy Lua values.
-- copy.lua
--
-- Lua functions of varying complexity to deep copy tables.
--
-- 1. The Problem.
--
-- Here's an example to see why deep copies are useful. Let's
-- say function f receives a table parameter t, and it wants to
@dannyid
dannyid / seek.js
Last active March 6, 2021 22:47
Netflix Seek
// The player
var player = netflix.cadmium.objects.videoPlayer();
// Metadata about current episode -- ID and url to get frame at a specific time
var episodeId = netflix.cadmium.metadata.getActiveVideo().episodeId;
var imgRoot = netflix.cadmium.metadata.getActiveVideo().progressImageRoot;
// Generates URL of preview image for given timestamp
function getFrame(timestamp) {
var t = Math.floor(timestamp/10000).toString(10);
@akora
akora / remove-diacritics-google-sheet
Created February 28, 2015 11:18
Removes all diacritics from strings (e.g. names) in a Google spreadsheet
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C2,"ö","o"),"ü","u"),"ó","o"),"ő","o"),"ú","u"),"é","e"),"á","a"),"ű","u"),"í","i"),"Ö","O"),"Ü","U"),"Ó","O"),"Ő","O"),"Ú","U"),"É","E"),"Á","A"),"Ű","U"),"Í","I")
@danbernier
danbernier / framework.js
Created November 4, 2015 19:27
A Tiny Framework for Automated Tests in Google Apps Script
function allTests(thisFnWrapsAllYourTests) {
var successes = 0;
var failures = [];
var scopes = [];
var msgInScope = function(msg) {
return scopes.concat([msg]).join(": ");
}
var doTheseListsMatch = function(expected, actual) {
@tomrus88
tomrus88 / gist:28fa1a4a25271e04616e
Last active August 2, 2023 01:35
WoW Lua Globals
_ERRORMESSAGE
AbandonQuest
AbandonSkill
AbbreviateLargeNumbers
AbbreviateNumbers
abs
AcceptAreaSpiritHeal
AcceptBattlefieldPort
AcceptDuel
AcceptGroup

Upload images to GitHub

  1. Create a new issue on GitHub.

  2. Drag an image into the comment field.

  3. Wait for the upload process to finish.

  4. Copy the URL and use it in your Markdown files on GitHub.

@dimapaloskin
dimapaloskin / Netflix.seek.js
Created October 18, 2017 18:32
Netflix seek
const videoPlayer = netflix
.appContext
.state
.playerApp
.getAPI()
.videoPlayer;
// Getting player id
const videoPlayer = videoPlayer
.getAllPlayerSessionIds()[0]
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 26, 2024 18:57
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).