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 / interest.js
Last active July 3, 2017 17:34
Calculate daily interest
// Daily interest calculating.
// >> node interest.js days amount interest
var args = process.argv.slice(2);
var interestDays = function(days, amount, interest) {
for (i = 0; i < days; i++) {
amount = Number(amount) + ((interest / 100) * amount);
}
return amount;
@arieljannai
arieljannai / vimium_custom_search_engines.md
Last active December 21, 2022 10:57
Vimium Custom search engine example, with my useful things

Some useful search engines I use

Name Setting Extra description and notes
Wikipedia w: http://en.wikipedia.org/wiki/Special:Search?search=%s
Home home: https://www.google.com/maps/dir/INPUT+HOME+LOCATION/%s Find your way from your home to places using Google Maps*
Recent recent: https://www.google.com/search?hl=en&tbo=1&tbs=qdr:y&q=%s Google results only for the last year
Stack Overflow so: http://stackoverflow.com/search?q=%s
Youtube yt: http://www.youtube.com/results?search_query=%s
Imdb imdb: http://www.imdb.com/find?s=all&q=%s
@arieljannai
arieljannai / dup.cmd
Last active January 27, 2018 19:54
Duplicates the given file or folder. Accept the regular copy command parameters as well
@echo off
rem if you want, you can change the cp command to the regular windows copy or xcopy or whatever copy command you like
for %%a in (%*) do set last=%%a
set source_file=%last%
set /a count=2
set all_params=%*
if exist "%source_file% - Copy" (
call :set_first_available_name "%source_file% - Copy (%count%)"
@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%
@arieljannai
arieljannai / DisableLogonBackgroundImage
Created August 2, 2015 20:13
DisableLogonBackgroundImage
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\DisableLogonBackgroundImage
<# 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>