Skip to content

Instantly share code, notes, and snippets.

View ahbanavi's full-sized avatar
🎯
Focusing

Amir ahbanavi

🎯
Focusing
View GitHub Profile
@ebraminio
ebraminio / gist:5292017
Last active May 26, 2024 09:47
Check Iranian National Code Validity - بررسی صحت کد ملی ایرانی - Clojure, C#, F#, Ruby, JavaScript, Dart, Python, Scala, Java 8, PHP, C, Go, Swift, Kotlin, Groovy, Rust, Haskell, Erlang, Elixir, PowerQuery M Language, VBA, R, Lua, Fortran, Pascal/Delphi, Excel, Stored Procedure / MySQL
// Check Iranian National Code Validity - Clojure, C#, F#, Ruby, JavaScript, Dart, Python, Scala, Java 8, PHP, C, Go, Swift, Kotlin, Groovy, Rust, Haskell, Erlang, Elixir, Power Query M Language, VBA, R, Lua, Fortran, Pascal/Delphi, Excel, Stored Procedure / MySQL
// بررسی صحت کد ملی ایران - کلوژر، سی‌شارپ، اف‌شارپ، روبی، جاوااسکریپت، دارت، پایتون، اسکالا، جاوا ۸، پی‌اچ‌پی، سی، گو، سوئیفت، کاتلین، گرووی، راست، هسکل، ارلنگ، الکسیر، پاورکوئری ام، وی‌بی ای، آر، لوآ، فرترن، پاسکال/دلفی، اکسل، مای‌اس‌کیوال
// در نسخه‌های قبل یکسان بودن اعداد نا معتبر تشخیص داده می‌شد ولی
// اعداد یکسان نامعتبر نیست https://web.archive.org/web/20170706081048/http://www.fardanews.com/fa/news/127747/رندترین-شماره-ملی-بلای-جان-صاحبش-شد
// بعضی از پیاده‌سازی‌ها سریع نیستند، می‌توانید نسخهٔ خود را بر پایهٔ
// نسخهٔ سی یا گو ایجاد کنید که بهترین سرعت را داشته باشد
/**
@hanks
hanks / exercises.go
Last active August 15, 2022 07:48
Exercises for a tour of go
// Exercise: Loops and Functions
package main
import (
"fmt"
)
func Sqrt(x float64) float64 {
z := 1.0
for i := 0; i < 10; i++ {
@mabasic
mabasic / helpers.php
Last active May 10, 2024 19:25
config_path function for Lumen framework
<?php
if ( ! function_exists('config_path'))
{
/**
* Get the configuration path.
*
* @param string $path
* @return string
*/
// ==UserScript==
// @name RTL tweetdeck
// @namespace http://py4.ir
// @version 0.1
// @description RTL support for tweetdeck without messing LTR.
// @author py4
// @match https://tweetdeck.twitter.com/*
// @grant none
// @include https://tweetdeck.twitter.com/*
// ==/UserScript==
@kt0
kt0 / tweetdeckrtl.user.js
Last active May 13, 2020 21:37
TweetDeck autortl
// ==UserScript==
// @name TweetDeck RTL checker
// @namespace http://twitter.com/keykakito
// @description TweetDeck RTL checker
// @include https://tweetdeck.twitter.com/
// @version 0.2
// @grant none
// ==/UserScript==
(function() {
@nikhan
nikhan / twitter.sh
Created January 1, 2016 04:45
twitter ffmpeg
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
@0x9090
0x9090 / torrc.examples.txt
Created February 8, 2016 06:47
torrc examples
This file is part of Whonix
Copyright (C) 2012 - 2014 Patrick Schleizer <adrelanos@riseup.net>
See the file COPYING for copying conditions.
**** Do NOT edit this file! ****
This file will show you examples you can copy and paste to /etc/tor/torrc
Additionally, you can read the official Tor Manual at:
https://www.torproject.org/docs/tor-manual.html.en
@marteinn
marteinn / readme.md
Last active May 9, 2021 04:20
Logging Flask Exceptions to Slack
  1. First off install the python package slacker-log-handler and add it to your requirements file.

    flask
    ...
    slacker-log-handler
  2. Generate a slack token.

@0xjac
0xjac / private_fork.md
Last active June 25, 2024 13:06
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@burhandodhy
burhandodhy / instagram.php
Created March 15, 2018 18:03
Get Instagram Follower Counts
<?php
$username = 'burhandodhy';
$response = @file_get_contents( "https://www.instagram.com/$username/?__a=1" );
if ( $response !== false ) {
$data = json_decode( $response, true );
if ( $data !== null ) {
$full_name = $data['graphql']['user']['full_name'];
$follower = $data['graphql']['user']['edge_followed_by']['count'];