Skip to content

Instantly share code, notes, and snippets.

View katywings's full-sized avatar
🦋

Katja Lutz katywings

🦋
View GitHub Profile
@katywings
katywings / gh-delete-greenkeeper-branches.js
Created April 20, 2019 13:57
Delete all branches starting with the name greenkeeper
Array.prototype.forEach.call($$('li[data-branch-name^="greenkeeper"] button[aria-label="Delete this branch"]'), function(el) { el.click() })
@katywings
katywings / difference.js
Created February 18, 2019 23:00 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
/**
* 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) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
@katywings
katywings / remix.js
Created May 23, 2017 15:48
Work in progress
class Com {
constructor(){
// Bind eventhandlers to this
this.click = this.click.bind(this)
// No sideeffects: Templates should use only parameterized eventhandlers or own eventhandlers without this
var v = remix(myDiv, { click: this.click, tag: 'button' })
// Attach view mnually, however you want
this.el = v.el
@katywings
katywings / usort_multi.php
Created May 18, 2017 19:07
Function for writing usorts with multible properties (with null last option)
<?php
$users = [
[ 'age' => 40, 'fingers' => 2 ],
[ 'fingers' => 4 ],
[ 'name' => 'Hans', 'age' => 9, 'fingers' => 3 ],
[ 'name' => 'Hans', 'age' => 9, 'fingers' => 6 ],
[ 'name' => 'Hans', 'age' => 14, 'fingers' => 2 ],
[ 'age' => 2 ],
[ 'name' => 'Alex', 'age' => 20, 'fingers' => 2 ],
@katywings
katywings / install_atom.sh
Created May 4, 2017 20:18
Downloads and installs atom
#!/bin/bash
su root;
# Open Downloads and download atom
cd ~/Downloads;
wget https://atom.io/download/rpm;
mv rpm atom.x86_64.rpm
# Install new atom
@katywings
katywings / install_node.sh
Last active July 15, 2020 14:35
Downloads and installs node
#!/bin/bash
# Symlinking to /usr/local/bin needs root access
# su root;
# Set which version
NODE_VERSION=12.18.2;
# Open Downloads and download node
cd ~/Downloads;
@katywings
katywings / redomx.js
Created April 25, 2017 16:46
Concept 2 of Redomx
tpl = (x) => {
return [
x(el('h1'), () => {
setAttr(this, {
title: this.title
})
}),
x(el('h1')
]
}
@katywings
katywings / redomx.js
Created April 25, 2017 05:35
Concept of Redomx
MyCom = function() {
var self = this
this.title = "Hello"
redomx(this, this.render)
setTimeout(function() {
this.title += "World"
this.update()
}, 500)
@katywings
katywings / launch_dartium
Created March 15, 2017 22:13
Launch Dartium command with separate instance
env DART_FLAGS=--checked /opt/dartium/chrome-wrapper --user-data-dir=~/.dartium
@katywings
katywings / 0_reuse_code.js
Created January 26, 2017 14:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console