Skip to content

Instantly share code, notes, and snippets.

@Yousha
Yousha / gist:e64e0bd144bc94b464ce8acf9c045111
Last active Mar 6, 2017
The optional parameter for Java. (Trick)
View gist:e64e0bd144bc94b464ce8acf9c045111
public void myMethod(final Object object, final boolean... enabled)
{
// ...
if (enabled[0])
{
// top kek
}
return;
@Yousha
Yousha / gist:7bf2d1f81578c72e2978391c57ad4f0a
Created Jan 22, 2019
Update forked(origin) repository from upstream
View gist:7bf2d1f81578c72e2978391c57ad4f0a
git clone git@github.com:myusername/myforkedrepo.git
git remote add upstream git://github.com/targetusername/targetrepo.git
git fetch upstream
git pull upstream master
@Yousha
Yousha / .gitattributes
Created Feb 13, 2019
.gitattributes for .Net developers.
View .gitattributes
* text=auto
###### Git
.gitattributes text
.gitignore text
.gitconfig text
.gitmodules text
##### Windows
*.bat text eol=crlf
@Yousha
Yousha / build.xml
Last active Feb 15, 2020
Simple build.xml template for PhING https://phing.info/
View build.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Conventions/Standards:
* Filenames consist of no more or less than two elements: name and extension
* Choose short descriptive filenames (must be less than 31 chars)
* Names must not contain dots
* Files containing PHP code must end with the extension .php
* The name portion of the file must be named exactly like the class it contains
* Buildfiles and configure rulesets must end with the extension .xml
* There must be only one class per file (no procedural methods allowed, use a
@Yousha
Yousha / .gitignore
Last active May 18, 2020
.gitignore for .Net developers.
View .gitignore
##### Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
@Yousha
Yousha / gist:1fc89ff78b02647a8f787a54c81b2c5c
Last active Jun 16, 2020
Install common PHP tools via Composer
View gist:1fc89ff78b02647a8f787a54c81b2c5c
composer global require phpunit/phpunit
composer global require phpunit/phpunit-skeleton-generator
composer global require phpunit/dbunit
composer global require phpunit/php-invoker
composer global require codeception/codeception
composer global require nette/tester
composer global require jonathantorres/construct
composer global require phing/phing
composer global require sebastian/phpcpd
composer global require phploc/phploc
@Yousha
Yousha / iToast.java
Last active Jun 16, 2020
Improved Android Toast.
View iToast.java
public static final void iToast(final Activity context, final String message)
{
context.runOnUiThread(new Runnable()
{
@Override
public void run()
{
Toast.makeText(context.getApplicationContext(), message, Toast.LENGTH_LONG).show();
}
});
View BIOS_default_passwords.txt
AWARD BIOS:
01322222
589589
589721
595595
598598
aLLy
aLLY
ALLY
ALFAROME
@Yousha
Yousha / gist:abddf4c79afd7e11db1dd33e8cb08da5
Created Jun 16, 2020
Clear Windows event-logs (run in PowerShell)
View gist:abddf4c79afd7e11db1dd33e8cb08da5
wevtutil el | Foreach-Object {Write-Host "Clearing $_"; wevtutil cl "$_"}
View gist:3a8631d953430cc9fa4077c6ce4bc974
Application name-version
Type
[Code]
Message
File
Line
Caller
Thread
Thread priority
Time