Skip to content

Instantly share code, notes, and snippets.

@blopa
blopa / how-to-get-the-redux-state-from-a-production-build-via-the-browser's-console-script-1.js
Created February 20, 2022 17:47
Code for post "How to get the Redux State from a production build via the browser's console"
const internalRoot = Array.from(document.querySelectorAll("*[id]")).find((el) => el?._reactRootContainer?._internalRoot?.current)?._reactRootContainer?._internalRoot?.current;
const state = (internalRoot?.pendingProps?.store || internalRoot?.stateNode?.store || internalRoot?.memoizedState?.element?.props?.store)?.getState?.();
@chadrien
chadrien / Makefile
Created June 3, 2015 12:21
Proxy commands in Makefile (useful for docker for instance)
SUPPORTED_COMMANDS := command1 command2
SUPPORTS_MAKE_ARGS := $(findstring $(firstword $(MAKECMDGOALS)), $(SUPPORTED_COMMANDS))
ifneq "$(SUPPORTS_MAKE_ARGS)" ""
# use the rest as arguments for the command
COMMAND_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(COMMAND_ARGS):;@:)
endif
command1:
@damien-biasotto
damien-biasotto / README.md
Last active April 9, 2017 20:43
Magento Security Patch SUPEE-53XX.

##Patch SUPEE_53XX for almost every versions of Magento.

###Here is the mapping patch version - magento version

  • SUPEE_5344 : For magento 1.8.0.0 to Magento 1.9.1.0
  • SUPEE_5345 : For magento 1.7.0.2
  • SUPEE_5346 : For Magento 1.6.1.0
  • SUPEE_5341 : For Magento 1.6.0.0
  • SUPEE_5390 : For Magento 1.5.1.0
  • SUPEE_5388 : For Magento 1.4.0.0 to 1.5.0.1
@drogus
drogus / Rakefile.rb
Created July 26, 2013 10:49
This is the example contents of the Rakefile, which you would use to run active record tasks without using Rails. It assumes using the same directories as rails uses: `db/migrate`, `config/database.yml`.
require 'bundler/setup'
require 'active_record'
include ActiveRecord::Tasks
db_dir = File.expand_path('../db', __FILE__)
config_dir = File.expand_path('../config', __FILE__)
DatabaseTasks.env = ENV['ENV'] || 'development'
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@leon
leon / nginx.conf
Created June 29, 2012 16:34
Nginx PHP-FPM Symfony 2 minimal config
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 24, 2024 14:56
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: