Skip to content

Instantly share code, notes, and snippets.

View Jalalx's full-sized avatar

Jalal Amini Robati Jalalx

View GitHub Profile
@Jalalx
Jalalx / gist:3a8b0eb558ee811e768d74902eea85a4
Last active April 29, 2022 08:37 — forked from afair/gist:2402068
Perl References for Kittens

Perl References

Simple Perl variables are called scalars. Examples of scalar values are

   $number      = 123;
   $string      = "String";
   $file_handle = open "<filename";
   $null_value  = undef;
 $instance = MyClass-&gt;new;
@Jalalx
Jalalx / README.md
Created August 19, 2021 08:12
Set and unset Shekan DNS settings using commandline on windows

What is this?

Following scripts help you easily set DNS settings to Shekan servers and resetting them back to default.

How to use?

  1. Save following cmd files on your system.
  2. Make sure you change the "Wi-Fi" to your network adapter name
  3. Remember to run these commands as an administrator.
@Jalalx
Jalalx / producer-consumer-channel.md
Last active August 14, 2021 18:53
Basic producer-consumer app using channels in golang

Create a file named app.go and paste following code in it:

package main

import (
	"fmt"
	"strconv"
	"time"
)
/*
mkdir OrderedNumbers
cd ./OrderedNumbers
dotnet new xunit
*/
using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;
@Jalalx
Jalalx / VS2019GitBash.md
Last active October 12, 2020 13:28
Adding Git Bash to Visual Studio 2019 Menu + Shortcut keys

Adding Git Bash to Visual Studio 2019 Menu + Shortcut keys

  1. Open Visual Studio 2019 and go to Tools > External Tools...

  2. Click Add button and fill the fields like this:

    • Title: Git Bash
    • Command: C:\Program Files\Git\git-bash.exe
    • Arguments:
    • Initial Directory: $(SolutionDir)

    and click Ok button.

@Jalalx
Jalalx / SearchInDefinitions.sql
Created June 20, 2020 17:57
Search in object definitions
DECLARE @SearchText varchar(100) = '%search-text%';
SELECT sm.object_id, OBJECT_NAME(sm.object_id) AS object_name, o.type, o.type_desc, sm.definition
FROM sys.sql_modules AS sm
JOIN sys.objects AS o ON sm.object_id = o.object_id
where sm.definition like @SearchText collate SQL_Latin1_General_CP1_CI_AS
ORDER BY o.type;
GO
@Jalalx
Jalalx / DeleteTwitterLikes.md
Last active July 10, 2023 06:45
Delete all twitter likes!

Steps:

  • Login to your Twitter web account.
  • Go to your likes tab in your profile
  • Press F12 (in Chrome and Firefox) and in the Console tab, paste the following code:
// Creates a timer that runs every second...
setInterval(function(){
    // Scroll down by 600px
    window.scrollBy(0, 600);
 
#!/bin/bash
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
RED='\033[0;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${YELLOW}Running pre push check...${NC}"
@Jalalx
Jalalx / XOR.py
Created October 20, 2019 19:16
XOR Neural Network in python using MLP Back-Propagation
import numpy as np
def sigmoid(x):
return 1.0 / (1.0 + np.exp(-x))
def sigmoid_prime(x):
return x * (1.0 - x)
epochs = 5000
input_size, hidden_size, output_size = 2, 3, 1
using System;
using System.Linq.Expressions;
using System.Text;
namespace ExpressionValueEvaluator
{
class Program
{
static string Name => "Some Value (Direct Property)";