Skip to content

Instantly share code, notes, and snippets.

@quangv
quangv / Recover-Scratch-Projects.md
Last active December 4, 2023 07:28
Potential ways to Recover Scratch Projects that's been deleted (Trash has been Emptied)

Potential ways to Recover Scratch Projects that's been deleted (Trash Emptied)

Method 1) Find the project URL in browser history.

If you cleared your trash (and your project with it), contrary to what people think, you can still get it back.

  1. Check your browser history.
  2. Try to find the scratch's project URL.
  3. Go to that URL, hopefully it'll still exist. (Be sure to be logged in with the scratch project owner)
    • Example: https://scratch.mit.edu/projects/934686450/editor
@quangv
quangv / Turn off Screen.bat
Created June 5, 2020 22:08
Turn off screens on Windows 10
powershell -command "Start-Sleep -s 2";
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)
@quangv
quangv / tmux_cheatsheet.markdown
Created September 9, 2019 06:23 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

https://www.youtube.com/watch?v=BHhA_ZKjyxo
How to manage your remote terminal sessions with tmux. If you keep lots of terminal windows open or use a tiling window manager such as i3, you'll love tmux for doing the same thing on a remote machine. This video covers the basics of using tmux.
A quick cheatsheet (partially inspired by http://www.danielmiessler.com/study/t... ):
# session management
tmux ls (or tmux list-sessions)
tmux new -s session-name
Ctrl-b d Detach from session
@quangv
quangv / .env
Last active July 3, 2018 15:21
AWS Lambda shell scripts
# Environment varialbes goes here
SAY='hello'
@quangv
quangv / gist:42732a0c15552122feec1781ca6850cc
Created April 6, 2018 15:04
Fulcro figwheel websocket-host
quang [2:47 AM]
Is there anyway to `./run-tutorial.sh` with a different `:websocket-host` ?
quang [3:32 AM]
I tried added `:websocket-host :js-client-host` to `tutorial` id in `project.clj` but that didn't work... I ended up having to edit the compiled `resources/public/js/tutorial/figwheel/client/socket.js` manually.
`JVM_OPTS=-Dfigwheel.port=8001 ./run-tutorial.sh` should do it for JDK8. The console message will still say 8080, but you can ignore it. For JDK 9, you’ll need: `JVM_OPTS="--add-modules java.xml.bind -Dfigwheel.port=8001" ./run-tutorial.sh`
@quangv
quangv / LICENSE
Last active October 4, 2017 06:04
Redux HOC Wrapper
Copyright 2017 Quang Van
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@quangv
quangv / .babelrc
Last active December 10, 2016 07:13
Monaca Vue.js Webpack config
{
"presets": ["es2015"]
}
@quangv
quangv / ReadMe.md
Last active August 29, 2015 14:17
PivotalTracker Solo-Mode Scripts

Minimalistic view for PivotalTracker Solo-Mode.

blog post

The CSS and JS can be loaded into pivotaltracker with extensions like: minimalist