Skip to content

Instantly share code, notes, and snippets.

View josephrexme's full-sized avatar
:octocat:
Training wolves and dragons

Joseph Rex josephrexme

:octocat:
Training wolves and dragons
View GitHub Profile

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@devbyray
devbyray / Strich.io Frontend Code review.md
Last active January 31, 2016 10:11
Strich.io Frontend Code review

Intro

For this Frontend Code review I did a check for Strich.io. The code can be checked here:

Development Architecture

  • Don't check-in the "node_modules", and "dist" folder. Add it to the .gitignore file. If people will use this repository, the must run Gulp by default, so it's gonna be overwritten. Instead check-in the package.json.

CSS

This is a collection of responsive techniques made possible by EQCSS that apply styles in situations CSS can't quite reach today without a little help from JavaScript.

EQCSS extends CSS syntax with the following ideas:

1) What if CSS could set a scope for a selector like a @media query for an element

2) What if CSS could add a block of CSS styles to the page when that selector is true

3) What if CSS could add responsive conditions to that selector

// Lazy (=on-demand) zip()
for (const [i, x] of zip(naturalNumbers(), naturalNumbers())) {
console.log(i, x);
if (i >= 2) break;
}
// Output:
// 0 0
// 1 1
// 2 2
// The reducer function looks at each action that comes in
// and based on the type generates a new state based on the
// previous state and any additional data the action carried
const reducer = (state, action) => {
switch (action.type) {
case "COUNT_INCREMENT":
return {
...state,
count: state.count + 1
};
/**
* Bit of code you can run in your developer toolbar or on https://jsfiddle.net .
*
* Fill in the characteristics of your own 'public file' solution and acceptance criteria.
*/
(function(){
'use strict';
// dec=10,hex=16,[A-Z0-9]=36, etc.
var CHARACTER_COMBINATIONS = 16,
@WebReflection
WebReflection / writeInGithub.js
Last active January 13, 2021 04:33
a silly script to write in your github timeline
/**
* so here the thing ... you go in your github page
* as example I go here: https://github.com/WebReflection
* you open your console
* you copy and paste this shit
* then you write and execute in the console
* write("Hi There!");
* NOTE: Pixel Font from a 2006 project of mine :-) http://devpro.it/pixelfont/
*/
function write(text, color, start) {
@FiniteLooper
FiniteLooper / gist:3230548
Created August 1, 2012 20:42
Total up the cost of all items in an Amazon wishlist
var list = $$("#item-page-wrapper .list-items table tbody .lineItemMainInfo .lineItemPart strong");
var total=0;
for(i=0; i<list.length;i++){
total += parseFloat(list[i].innerText.replace("$",""));
}
alert(list.length+" items for a total of: $"+total.toFixed(2));
@jlongster
jlongster / immutable-libraries.md
Last active September 11, 2021 08:32
List of immutable libraries

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing

@tomhodgins
tomhodgins / cibc2csv.js
Last active December 4, 2021 21:24
Paste this function into your JS console on CIBC's online banking website to scrape your account ledger into a CSV formatted file the browser can save that can be imported into Excel
function cibc2csv() {
var table = document.querySelector('table.smart-account')
var csv = ''
var head = []
var row = []
// read header cells
table.querySelectorAll('thead th').forEach(th => {
head.push(`${trim(th.textContent)}`)
})