Skip to content

Instantly share code, notes, and snippets.

@cesasol
cesasol / pnpm-install
Created October 10, 2018 23:13
pnpm install solver
#!/bin/sh
# This is a simple hack to fix the pnpm module resolution, if you encounter "Module not found" in some deep dependency of your
# project, then use this script to add those not founded dependencies as a direct dev dependency.
# All credit goes to flaviut https://github.com/pnpm/pnpm/issues/1261
while true; do pnpm install -D $(pnpm start 2>&1 | grep 'Error: Cannot find module' | sed "s/Error: Cannot find module '\([a-z.-]\+\)'/\1/g"); done
@Pulimet
Pulimet / AdbCommands
Last active July 20, 2024 12:55
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@indiesquidge
indiesquidge / objects-over-classes.md
Last active January 17, 2024 09:30
We are better off avoiding ES6 classes in JavaScript when possible

Plain JavaScript objects are better than classes when they can be used, and many popular modern frameworks have adopted their use.

Consider that in React a component can be created as either a class or as an object.

// using a class
class Welcome extends React.Component {
  render() {
 Hello, {this.props.name}
@AlexVKO
AlexVKO / passwords_controller.rb
Created November 3, 2015 05:15
Allow devise to reset password signed in
class PasswordsController < Devise::PasswordsController
# here we need to skip the automatic authentication based on current session for the following two actions
# edit: shows the reset password form. need to skip, otherwise it will go directly to root
# update: updates the password, need to skip otherwise it won't even reset if already logged in
skip_before_filter :require_no_authentication, :only => [:edit, :update]
# we need to override the update, too.
# After a password is reset, all outstanding sessions are gone.
# When already logged in, sign_in is a no op, so the session will expire, too.
# The solution is to logout and then re-login which will make the session right.
= Arch Linux step-by-step installation =
= http://blog.fabio.mancinelli.me/2012/12/28/Arch_Linux_on_BTRFS.html =
== Boot the installation CD ==
== Create partition ==
cfdisk /dev/sda
* Create a partition with code 8300 (Linux)
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@zachstronaut
zachstronaut / gist:1184900
Created August 31, 2011 22:22
Stretch HTML5 canvas to fill window, preserving aspect ratio
/**
* fullscreenify()
* Stretch canvas to size of window.
*
* Zachary Johnson
* http://www.zachstronaut.com/
*
* See also: https://gist.github.com/1178522
*/