Skip to content

Instantly share code, notes, and snippets.

View phts's full-sized avatar
:octocat:
👾⛱🥁🏡🎧👓🌤🚼🛸🚗🕹🚂🌇🇵🇱🚭🇳🇱🇧🇾🔭🛠🖥🎹♠🥌

Phil Tsaryk phts

:octocat:
👾⛱🥁🏡🎧👓🌤🚼🛸🚗🕹🚂🌇🇵🇱🚭🇳🇱🇧🇾🔭🛠🖥🎹♠🥌
View GitHub Profile
@phts
phts / make_bootable_usb_flash_drive.bat
Last active November 12, 2016 05:50
Make a bootable NTFS usb flash drive
diskpart
list disk
select disk <X>
clean
create part pri
select part 1
format fs=ntfs quick
active
exit
@phts
phts / set_short_names_to_system_folders.bat
Last active August 29, 2015 14:01
Set short names to system folders
c:
cd /
fsutil file setshortname "C:\Program Files" PROGRA~1
fsutil file setshortname "C:\Program Files (x86)" PROGRA~2
fsutil file setshortname "C:\Program Files\Common Files" COMMON~1
fsutil file setshortname "C:\Program Files (x86)\Common Files" COMMON~1
pause
@phts
phts / NtfsDisable8dot3NameCreation.reg
Last active January 7, 2016 19:19
Enable auto creation of short file names
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"NtfsDisable8dot3NameCreation"=dword:00000002
@phts
phts / modify-deb-package.sh
Last active August 29, 2015 14:05
Modify files in deb package
#!/bin/bash
# From http://ubuntuforums.org/showthread.php?t=636724
DEBFILE="$1"
TMPDIR=`mktemp -d /tmp/deb.XXXXXXXXXX` || exit 1
OUTPUT=`basename "$DEBFILE" .deb`.modfied.deb
if [[ -e "$OUTPUT" ]]; then
echo "$OUTPUT exists."
rm -r "$TMPDIR"
@phts
phts / git-everyday-commands.md
Last active January 28, 2016 15:58
Git commands that are being used every day

HEAD^ - First parent commit

HEAD~x - xth parent commit

git reset HEAD -- file - Unstage file

git checkout -- file - Revert local changes (checkout file from the current branch)

git checkout branch -- file - Get a file from other branch

@phts
phts / cmd-environment-variables.md
Created September 30, 2014 15:42
Windows Cmd environment variable list
> set
  • %SystemDrive% - C:
  • %SystemRoot% - C:\WINDOWS
  • %WinDir% - C:\WINDOWS
  • %SystemDirectory% - C:\WINDOWS\System32
  • %ComSpec% - The path including the command interpreter program (C:\WINDOWS\system32\cmd.exe)
  • %programfiles% - C:\WINDOWS\Program Files
@phts
phts / ruby-time-interpolation-arguments.md
Created September 30, 2014 15:47
Ruby time interpolation arguments
  • %a - The abbreviated weekday name ("Sun")
  • %A - The full weekday name ("Sunday")
  • %b - The abbreviated month name ("Jan")
  • %B - The full month name ("January")
  • %c - The preferred local date and time representation
  • %d - Day of the month (01..31)
  • %H - Hour of the day, 24-hour clock (00..23)
  • %I - Hour of the day, 12-hour clock (01..12)
  • %j - Day of the year (001..366)
  • %m - Month of the year (01..12)
@phts
phts / github-commit-references.md
Last active August 29, 2015 14:07
Some useful things related to GitHub
  • SHA - be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
  • User@SHA ref - phts@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
  • User/Project@SHA- phts/my-project@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
  • #Num - #1
  • User/#Num - phts#1
  • User/Project#Num - phts/my-project#1

From stackoverflow

/*****************
* cellBlockA.js *
*****************
*
* Good morning, Dr. Eval.
*
* It wasn't easy, but I've managed to get your computer down
* to you. This system might be unfamiliar, but the underlying
* code is still JavaScript. Just like we predicted.
*
@phts
phts / clean-aliexpress-com.user.css
Last active July 20, 2018 17:25
Remove ads and other redundant stuff from aliexpress.com
/* ==UserStyle==
@name Clean up aliexpress.com
@description Remove ads and other redundant stuff from aliexpress.com
@namespace https://github.com/phts/
@version 1.0.2
==/UserStyle== */
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("aliexpress.com") {