Skip to content

Instantly share code, notes, and snippets.

View LGUG2Z's full-sized avatar

جاد LGUG2Z

View GitHub Profile
@EBNull
EBNull / forcefocus.py
Created December 1, 2011 19:11
Force windows application focus (attempting to bypass SetForegroundWindow restrictions)
import platform
#wnd is a HWND
def forceFocus(wnd):
if platform.system() != 'Windows':
return
SPI_GETFOREGROUNDLOCKTIMEOUT = 0x2000
SPI_SETFOREGROUNDLOCKTIMEOUT = 0x2001
SW_RESTORE = 9
@P7h
P7h / IntelliJ_IDEA__Perf_Tuning.txt
Last active July 6, 2024 10:42
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@ktraff
ktraff / sublime-keymap-escape-blocks.json
Last active June 3, 2021 19:18
Tab key to escape parentheses, quotes, or brackets in Sublime Text
// tab escape parenthesis, quotes, etc...
{ "keys": ["tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
{ "key": "preceding_text", "operator": "regex_contains", "operand": "[^ \t]+", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^[)'\"\\]]", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
// prevent tab escape when cycling through snippet fields
{ "key": "has_next_field", "operator": "equal", "operand": false }
]
}
@archagon
archagon / robocopy-backup
Last active January 22, 2024 03:38
A bunch of robocopy flags to help backup an external drive.
robocopy /b /e /xa:s /xjd /sl /a-:hs /mt /v /fp /eta /log:"D:\To\Directory\transfer.log" /tee "C:\From\Directory" "D:\To\Directory"
(Note that the paths don't have a trailing backslash.)
/b -- backup mode (there's a /zb option for restart mode, but it's a whole lot slower)
/e -- copies subdirectories (including empty directories) in addition to files
/xa:s -- exclude system files
/xjd -- exclude junction points
/sl -- copy symbolic links as links
/a-:hs -- remove hidden/system attributes from files
robocopy /b /e /xa:s /xjd /sl /a-:hs /mt /v /fp /eta /log:"D:\To\Directory\transfer.log" /tee "C:\From\Directory" "D:\To\Directory"
(Note that the paths don't have a trailing backslash.)
/b -- backup mode (there's a /zb option for restart mode, but it's a whole lot slower)
/e -- copies subdirectories (including empty directories) in addition to files
/xa:s -- exclude system files
/xjd -- exclude junction points
/sl -- copy symbolic links as links
/a-:hs -- remove hidden/system attributes from files
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@leipert
leipert / rules.rb
Last active January 29, 2017 03:16
Full brew and brew cask upgrade cycle in https://github.com/benjaminoakes/maid
#
# Full brew and brew cask upgrade cycle in https://github.com/benjaminoakes/maid
#
Maid.rules do
### Homebrew:
rule 'Updating brew formulas' do
log(`brew update`)
end
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active March 25, 2024 13:55
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@chanux
chanux / traefik-basic.md
Last active September 13, 2020 02:06
Traefik quick setup

Traefik quick setup

This is a bare minimum guide to try traefik with Docker.

Create traefik.toml file with preferred configuration

port = ":80"

[web]
@ain322
ain322 / update-casks.sh
Last active July 14, 2016 16:14
Script to update all applications installed using brew cask
#!/bin/sh
# Blindly updates all the applications previously installed using brew cask
brew update
brew cask list | xargs brew cask info | grep -A 1 "Not installed" | grep "github" | sed 's|https://github.com/caskroom/homebrew-cask/blob/master/Casks/\(.*\)\.rb|\1|' | xargs brew cask install
brew cask cleanup