Skip to content

Instantly share code, notes, and snippets.

View WesSouza's full-sized avatar
🚥
Working on code.

Wes Souza WesSouza

🚥
Working on code.
View GitHub Profile
@mano8
mano8 / linux ssh.md
Last active May 25, 2024 11:02
Installation of ssh server on linux

Install ssh-server

# sudo apt-get update # sudo apt-get install openssh-server

See status: # sudo systemctl status ssh

Backup the ssh configuration: # sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_backup

@zehfernandes
zehfernandes / optimize-assets.md
Last active August 28, 2023 14:18
Recursively optimize MOV, MP4, WEBp using command line

Optimize assets

.mov to .mp4

Convert and remove the .mov file from all folders in the given directory.

find . -type f -name "*.mov" -exec bash -c 'ffmpeg -i "$0" -vcodec h264 "${0%.*}.mp4" && rm "$0"' "{}" \;
@macserv
macserv / FruitCorners.txt
Created May 8, 2019 16:16
A brief history of the Fruit Corners brand (1980–1987) from General Mills
Thank you for contacting General Mills with your inquiry. We have enclosed all information we have available regarding the Fruit Corners line of products.
We hope you find this information helpful. Please let us know if we can help you again
Sincerely,
Katie Gafler
Consumer Services
@dereknelson
dereknelson / store.js
Created April 26, 2019 00:39
redux profiler
//...store logic
// profiler for redux actions
const userTiming = (store) => (next) => (action) => {
if (performance.mark === undefined) return next(action)
performance.mark(`${action.type}_start`);
const result = next(action);
performance.mark(`${action.type}_end`);
performance.measure(`${action.type}`,`${action.type}_start`,`${action.type}_end`,)
return result
@bvaughn
bvaughn / infinite-lists-and-reflow.md
Last active December 27, 2023 18:51
Infinite lists and reflow

Infinite lists and reflow

In my experience, infinite lists use two basic layout strategies. The first uses absolute positioning to control where visible items are rendered. The second uses relative positioning (with top/left padding to offset for unrendered items).

In both cases, the list abstraction caches some metadata about the size of items once they have been rendered– so that it knows where to position the items that come after them.

Both of these strategies need to handle reflow. For example, changing the width of a list often affects the height of its itesm. Generally speaking, only the "window" of rendered (visible) items are remeasured in this case (because it would be too slow to rerender and remeasure all of the items before). But once a user scrolls backwards (up/left)– the list needs to account for the reflowed sizes. If it didn't, items would appear to jump up or down (depending on the delta between the previous, cached sizes and the new/reflowed sizes).

How the list deals with new sizes

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active June 28, 2024 14:47 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@andymatuschak
andymatuschak / States-v3.md
Last active June 12, 2024 04:17
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

@ricardobeat
ricardobeat / README.md
Last active April 14, 2020 18:19
git remaster

git-remaster updates both your current branch and master branch simultaneously, while preserving all commited, staged and unstaged changes.

Install

Add git-remaster to your path and make it executable:

curl https://gist.githubusercontent.com/ricardobeat/9600953/raw/git-remaster.sh > /usr/local/bin/git-remaster
chmod +x /usr/local/bin/git-remaster
@cobyism
cobyism / gh-pages-deploy.md
Last active June 26, 2024 23:06
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@iambibhas
iambibhas / scopes.txt
Last active June 16, 2024 20:45
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee