Skip to content

Instantly share code, notes, and snippets.

View arieljannai's full-sized avatar

Ariel Jannai arieljannai

View GitHub Profile
@arieljannai
arieljannai / ctor_abstract_inherit.cs
Last active August 29, 2015 14:10
Example for Yoni - abstract class and ctor inheritance
namespace Yoni
{
static class Program
{
static void Main()
{
AlmightyKing ariel = new AlmightyKing("Ariel", "Jannai", "Your Majesty", "The Milky Way");
Console.WriteLine("calling SayName() of the base class - SimpleHuman");
Console.WriteLine(ariel.SayNameOriginal());
Console.WriteLine("\ncalling SayName() - the overrided function in AlmightyKing");
@arieljannai
arieljannai / download-chrome-extension.sh
Last active August 29, 2015 14:10
Download chrome extension
#!/bin/bash
# work in progress
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} [-h] <-a APP_ID>...
Do stuff with FILE and write the result to standard output. With no FILE
or when FILE is -, read standard input.
@arieljannai
arieljannai / cmder.bat
Last active August 29, 2015 14:24
open cmder in current folder (from location bar)
@REM put that file in system32 or something, and change %PATH_TO_CMDER% to cmder installation
@REM when you're in an explorer folder window, press F4 to focues on the location bar, and then type cmder. yay.
%PATH_TO_CMDER%\cmder\Cmder.exe /START %CD%
<# taken from:
# http://forums.windowscentral.com/ask-question/370145-windows-10-pro-no-apps-working-activation-issue.html#post3181614
# Run the powershell console as administrator
#>
Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
@arieljannai
arieljannai / after-adding-string.docx.xml
Last active August 29, 2015 14:26
add string to docx through xml files
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:lc="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas" xmlns:dgm="http://schemas.openxmlformats
@arieljannai
arieljannai / language-file_he-il_Windows-10-Login-Background-Changer.xml
Last active August 29, 2015 14:27
a Hebrew language file for Windows-10-Login-Background-Changer
<?xml version="1.0" encoding="utf-8"?>
<Language>
<lang_name>עברית</lang_name>
<title_error>שגיאה</title_error>
<title_info>מידע</title_info>
<title_warning>אזהרה</title_warning>
<title_finished>הסתיים</title_finished>
<title_success>הצלחה!</title_success>
<title_eula>תנאי שימוש</title_eula>
<title_bg_disabled>הרקע הושבת</title_bg_disabled>
// for this purpose we used the icon propery of our tree object to identify that it is a file (a folder doesn't have an icon, it uses the default one)
var customTreeSort = function(a, b) {
if (this.get_node(a).icon === 'jstree-file' && this.get_node(b).icon === 'jstree-file') {
// organize files
return this.get_text(a).localeCompare(this.get_text(b));
} else {
// files before folders
if (this.get_node(a).icon === 'jstree-file') {
return -1;
@arieljannai
arieljannai / private-chrome-store.reg
Last active January 18, 2016 13:28
To allow installing chrome extensions (crx) from sources other then chrome web store (private stores)
Windows Registry Editor Version 5.00
; To allow installing chrome extensions (crx) from sources other then chrome web store, add this registry to your computer
; And don't forget to change the urls to your private chrome store
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallSources]
"1"="http://webstore.mysite.com/ChromeExt/*"
"2"="http://another-source.mysite.com/ChromeExt/*"
@arieljannai
arieljannai / curl-commands.sh
Created January 26, 2016 13:46
Mozilla add ons api
# the node app retrieves the jwt token
# result in: upload-amo-result.json
echo "curl https://addons.mozilla.org/api/v3/addons/{%%%ADDON_UUID%%%}/versions/%%%ADDON_VERSION%%%/ -XPUT --form 'upload=@C:/firefox-addon.xpi' -H 'Authorization: $(node index.js)'" | sh
# result in: status-amo-result.json
echo "curl https://addons.mozilla.org/api/v3/addons/%%%UPLOADER_MOZILLA_DEV_MAIL%%%/versions/%%%ADDON_VERSION%%%/uploads/%%%UPLOAD_PK%%%/ -H 'Authorization: $(node index.js)'" | sh
@arieljannai
arieljannai / users-with-password-expired.ps1
Created January 31, 2016 10:35
Get all the users that their password has been expired (expiry date is set to the epoch date 1/1/1601 2:00:00 AM)
Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} -Properties "SamAccountName", "DisplayName", "msDS-UserPasswordExpiryTimeComputed" | Select-Object -Property "SamAccountName", "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} | Where-Object {$_.ExpiryDate -like '*1601*'}