Skip to content

Instantly share code, notes, and snippets.

View kissu's full-sized avatar
🍉

Konstantin BIFERT kissu

🍉
View GitHub Profile
@microbial
microbial / rename.js
Last active February 26, 2021 04:36
lodash helpers - rename (renames object keys)
/*
* var person = { firstName: 'bill', lastName: 'johnson' }
*
* person = _.rename(person, 'firstName', 'first')
* person = _.rename(person, 'lastName', 'last')
*
* console.log(person) // { first: 'bill', last: 'johnson' }
*/
_.rename = function(obj, key, newKey) {

Happy Freelancing

Je m’appelle Thibaut Assus, j’ai 30 ans, je suis freelance en développement web et ma technologie de prédilection est le Ruby on Rails. J’ai maintenant un peu d’expérience dans le domaine du freelancing et ce document a pour but de partager avec vous une partie de cette expérience.

Mon parcours de développeur Ruby

As noted by @murdats below, there are more URLs than just these 1440 ones, depending on the argument values
that are hashed (as the filenames below are MD5 hashes of a few arguments: red/blue pill color, HHMM time, etc.)
You can read details about the algorithm used to generate these URLs here:
https://news.ycombinator.com/item?id=28448335
---
00:00 https://thechoiceisyours.whatisthematrix.com/generated/v7/high/d43725991d28ffcab04aa716762cf6af.mp4
@Mazuh
Mazuh / compact-object.js
Last active September 22, 2022 07:21
Remove all empty objects and undefined values from a nested object -- an enhanced and vanilla version of Lodash's `compact`.
function compactObject(data) {
if (typeof data !== 'object') {
return data;
}
return Object.keys(data).reduce(function(accumulator, key) {
const isObject = typeof data[key] === 'object';
const value = isObject ? compactObject(data[key]) : data[key];
const isEmptyObject = isObject && !Object.keys(value).length;
if (value === undefined || isEmptyObject) {
@JesterXL
JesterXL / promiseall.js
Last active October 31, 2022 16:02
Example of using Array Destructuring for Promise.all.
Promise.all([
someThingThatReturnsAPromise(),
otherThingThatReturnsAPromise(),
lastThingThatReturnsAPromise()
])
.then( results =>
{
// this...
const [first, second, third] = results;
// ... instead of
@hamidzr
hamidzr / sof-audio-setup-carbonx1.sh
Last active June 2, 2023 01:43
Lenovo Carbon X1 Gen 7 - Audio and microphone fix - https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_7) might be all you need.
#!/bin/bash
# README You probablyl don't need this script anymore. Please read the comments below to catch up.
## Description
# Lenovo Carbon X1 Gen 7 - Audio and microphone fix - kernel 5.3+ required.
# The script has only been tested for Arch and OpenSuse,
# Original thread: https://forums.lenovo.com/t5/Ubuntu/Guide-X1-Carbon-7th-Generation-Ubuntu-compatability/td-p/4489823
# Prereq: Install Linux 5.3 or newer

An introduction to alternative keyboard layouts

This is a post to satisfy your curiosity about alternative keyboard layouts, why some people use them, and whether they're for you. It is intended to discuss the topic in broad terms, but I will share my personal preferences towards the end. Due to time constraints and my own limited knowledge, I will focus on layouts optimized for the English language (ANSI variants, with an occasional nod to ISO).

First off, it's important to understand how much debate there is about how we got here: I will not even attempt to settle the issue of who invented the 'first' typewriter layout, because the modern device had many predecessors going back centuries. The usual legend of typewriter evolution holds that American Christopher Latham Sholes debuted the typewriter in 1868 with a 2-row layout that was (nearly) alphabetical. A horizontal stagger between the rows made room for the lever arms attached to each key:


 3 5 7 9 N O P Q R S T U V W X Y Z
2 4 6 8 . A B C D E
@tonmcg
tonmcg / README.md
Last active January 4, 2024 06:50
Moving Bubbles + Vue + GSAP + D3

This visualization tracks a sample of couples in the 1970's to show how long they transition through relationship stages. It is wholly based on Nathan Yau's The Stages of Relationships, Distributed and his companion tutorial How to Make a Moving Bubble Chart, Based on a Dataset (note: you'll need a FlowingData membership to view this tutorial.)

Nathan's example uses D3.js to get the data, render the text and circles, simulate physical forces, apply transitions and animations, and update DOM elements. This example uses the browser's native Fetch API to get the data, Vue.js instance lifecycle statges to update the data and render the circles and text; GSAP to transition and animate SVG circle

@jasonrhodes
jasonrhodes / getProperty.js
Created April 6, 2012 17:40
Get a nested object property by passing a dot notation string as the property name
/**
* A function to take a string written in dot notation style, and use it to
* find a nested object property inside of an object.
*
* Useful in a plugin or module that accepts a JSON array of objects, but
* you want to let the user specify where to find various bits of data
* inside of each custom object instead of forcing a standardized
* property list.
*
* @param String nested A dot notation style parameter reference (ie "urls.small")
@tigt
tigt / git-branch-to-favicon.js
Created March 18, 2020 21:10
Creates an SVG string that can be used as a favicon across different Git branches. Actually getting this into the browser is sadly project-specific.
const { execSync } = require('child_process')
const { createHash } = require('crypto')
const invertColor = require('invert-color')
const branchName = execSync('git rev-parse --abbrev-ref HEAD')
const hash = createHash('sha256')
hash.update(branchName)
const color = '#' + hash.digest().toString('hex').substring(0, 6)
const invertedColor = invertColor(color, true)