Skip to content

Instantly share code, notes, and snippets.

View ashkanRmk's full-sized avatar
:octocat:
Doing what makes me happy!

Ashkan Rahmani ashkanRmk

:octocat:
Doing what makes me happy!
View GitHub Profile
@ashkanRmk
ashkanRmk / js
Created February 7, 2017 19:52
first snippest
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
cssmin = require('gulp-cssmin'),
imagemin = require('gulp-imagemin');
gulp.task('images', function () {
@ashkanRmk
ashkanRmk / fix_drive.sh
Created May 6, 2017 19:16
Script for fixing unmounted drive in linux
#!/bin/bash
#You can Insert line of these code for each one of your HDD Drive
#Like this: sudo ntfsfix /dev/sd[NUMBER]
sudo ntfsfix /dev/sda6
sudo ntfsfix /dev/sda5
sudo ntfsfix /dev/sda3
#If your windows has been hibernated You can't fix Drive C
graph = {'A': ['B', 'C'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F'],
'F': ['C']}
def find_shortest_path(graph, start, end, path=[]):
path = path + [start]
@ashkanRmk
ashkanRmk / install-docker-linuxmint.sh
Created September 5, 2017 16:16
Make it executable and Run the Script.
#!/bin/bash
while true; do
read -p "This script will install latest Docker on your system. Continue? (Y/N)" answer
case $answer in
[Yy]* )
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo echo deb https://apt.dockerproject.org/repo ubuntu-xenial main | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get purge lxc-docker
@ashkanRmk
ashkanRmk / remove-dotnet.sh
Created September 12, 2017 16:05
Script for remove previous version of dot net
#!/usr/bin/env bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
current_userid=$(id -u)
if [ $current_userid -ne 0 ]; then
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Globalization;
using System.Data.EntityClient;
using System.Data.SqlClient;
using System.Data.Common;
from telegram import ParseMode
from telegram.ext import Updater
import time
updater = Updater('BOT-TOKEN-ID')
chatIds = ["109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039",
"109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039",
"109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039",
"109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039",
curl --request POST \
--url 'https://stageacc.payping.io/connect/token' \
--header 'content-type: application/json' \
--data '{"grant_type":"authorization_code","client_id": "YOUR_CLIENT_ID","client_secret": "YOUR_CLIENT_SECRET","code": "YOUR_AUTHORIZATION_CODE","redirect_uri": "https://YOUR_APP/callback"}'
{
"access_token": "aec5a4225.....f25",
"expires_in": 3600,
"token_type": "Bearer"
}
function base64URLEncode(str) {
return str.toString('base64')
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=/g, '');
}
var verifier = base64URLEncode(crypto.randomBytes(32));