Skip to content

Instantly share code, notes, and snippets.

View samirmhsnv's full-sized avatar
👋

Samir Mammadhasanov samirmhsnv

👋
View GitHub Profile
@Miri92
Miri92 / Payment.php
Created August 9, 2020 07:56
KapitalBank Payment API with PHP Laravel framework - Example snippet
<?php
namespace App\Models;
use App\Database\EloquentModel as Model;
class Payment extends Model
{
protected $fillable = ['order_id', 'session_id', 'currency', 'order_status', 'order_description', 'amount', 'payment_url', 'status_code','order_check_status','language_code'];
@V-ed
V-ed / .. Setting up a new Raspberry Pi.md
Last active June 21, 2020 10:09
Raspberry Pi Basic Setup with Pi-hole + OpenVPN installation

Setting up a new headless Raspberry Pi from Scratch : A Quickstart Guide

Note : These instructions have been tested for the Raspberry Pi 3B+ and Raspberry Pi 4B. You can try these on older versions, but I have no guarantee that these instructions will work correctly.

Enabling SSH before the first boot of the Raspberry Pi

To enable SSH in your Raspberry pi before actually booting it up, simply create a file named ssh (with no extension) in the boot partition of your card.

Ref : https://www.raspberrypi.org/documentation/configuration/wireless/headless.md

@isluewell
isluewell / AppName.php
Last active May 11, 2023 12:18
[6.0] Command app:name
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Composer;
use Symfony\Component\Finder\Finder;
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Console\Input\InputArgument;
@avillegasn
avillegasn / heatmap-hidden.js
Last active March 12, 2023 06:45
Scripts to play with heatmaps in a web
(function(a,b,c){if(typeof module!=="undefined"&&module.exports){module.exports=c()}else if(typeof define==="function"&&define.amd){define(c)}else{b[a]=c()}})("h337",this,function(){var a={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};var b=function h(){var b=function d(a){this._coordinator={};this._data=[];this._radi=[];this._min=0;this._max=1;this._xField=a["xField"]||a.defaultXField;this._yField=a["yField"]||a.defaultYField;this._valueField=a["valueField"]||a.defaultValueField;if(a["radius"]){this._cfgRadius=a["radius"]}};var c=a.defaultRadius;b.prototype={_organiseData:function(a,b){var d=a[this._xField];var e=a[this._yField];var f=this._radi;var g=this._data;var h=this._max;var i=this._min;var j=a[this._valueField]||1;var k=a.radius||this._cfgRadius||c;if(!g[d]){g[d]=[];f[d]=[]}if(!g[d][e]){g[d
@sabahtalateh
sabahtalateh / useful_bash_commands.sh
Last active June 21, 2020 10:04
Useful bash commands
## Super Hot
cd - # go to previous directory.
## Copy public key to servers that I want to be accessible to connects to me
# server1 should be configured via ~/.ssh/config like
# Host server1
# HostName 10.0.2.4
# User sabahtalateh
# Port 22
ssh-copy-id -i id_rsa.pub server1
@mort3za
mort3za / git-auto-sign-commits.sh
Last active January 30, 2024 10:31
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
# Distributions: RHEL_6+7 CentOS_6+7
##########################################################################
# Standard rsync command
##########################################################################
- Useful when live cloning servers.
rsync -avX --one-file-system --hard-links --numeric-ids -e 'ssh -c arcfour' /source dest:/nation
(remember to run --delete for the last sync)
@helanan
helanan / 404-svg-animated-page-concept-for-e-store-zajno-illustrated-by-lina.markdown
Created October 13, 2016 04:50
404 svg animated page concept for e-store @ Zajno (Illustrated by Lina)
@mojowen
mojowen / .aliases
Last active June 21, 2020 10:11
My dotfiles
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# Shortcuts
alias d="cd ~/desktop"
@cirocosta
cirocosta / iframe.html
Last active January 6, 2024 23:02
Sending messages from child iframe to parent webpage
<!DOCTYPE html>
<html>
<head>
<title>My Iframe</title>
</head>
<body>
<button>Botão</button>
<script type="text/javascript">