Skip to content

Instantly share code, notes, and snippets.

View j0lv3r4's full-sized avatar
🎯
Focusing

Juan Olvera j0lv3r4

🎯
Focusing
View GitHub Profile
@RobertAKARobin
RobertAKARobin / observables.md
Last active August 30, 2021 15:46
Other articles on observables are dumb

Other articles on observables are dumb

1. They use bad examples

Anything can be an observable!! Even data that never changes!!!

const myObservable = Observable.from('Hello world');
myObservable.subscribe(data => console.log(data));

It prints 'Hello world'! Amazing!!

@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

@fnky
fnky / emotion.d.ts
Last active September 27, 2019 18:37
Rebass Emotion with Theming support
declare module 'rebass/emotion' {
import * as Rebass from 'rebass';
import { ComponentClass } from 'react';
import { ThemeProviderProps } from 'emotion-theming';
// Styled System Types
export type NumberOrString = Rebass.NumberOrString;
export type Responsive = Rebass.Responsive;
export interface Space extends Rebass.Space {}
@myshov
myshov / function_invocation.js
Last active January 21, 2024 15:14
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@AlexLamson
AlexLamson / backup-rescuetime.py
Last active May 6, 2020 19:08
A simple python script to backup rescuetime data every month
#!/usr/bin/python3
# backup-rescuetime.py: Backup all of last month's rescuetime data
#
# Columns are Date,Time Spent (seconds),Number of People,Activity,Category,Productivity
# Rows are hourly breakdowns of the activities done
#
# Must have directory called 'rescuetime_data' in same directory as script
#
# Sample crontab entry to backup at 6AM on the 1st of every month:
# 0 6 1 * * python3 ~/rescuetime/backup-rescuetime.py
@k88hudson
k88hudson / bare-bones-react-webpack.js
Last active February 13, 2017 19:34
Bare-bones react/webpack set-up
/* First, install dependencies:
npm install webpack babel-loader babel-core babel-preset-react --save-dev
npm install react react-dom --save
Note: babel dependencies are not needed if you aren't using jsx)
*/
// webpack.config.js
// Note: This assumes a "main.js" file in a src/ directory, and outputs "main.bundle.js" to a dist/ directory
@paulirish
paulirish / what-forces-layout.md
Last active April 14, 2024 08:07
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@leafo
leafo / app.lua
Last active August 29, 2015 14:03
local lapis = require "lapis"
local app = lapis.Application()
app:get("/", function()
local http = require "lapis.nginx.http"
local util = require "lapis.util"
local api = "https://www.googleapis.com/pagespeedonline/v1/runPagespeed?"
local res, status = http.simple(api .. util.encode_query_string {
url = "http://leafo.net",
@staltz
staltz / introrx.md
Last active April 15, 2024 10:24
The introduction to Reactive Programming you've been missing