Skip to content

Instantly share code, notes, and snippets.

Avatar
📱
Learning and developing

Ahmed Helal AhmedHelalAhmed

📱
Learning and developing
View GitHub Profile
@ddeveloperr
ddeveloperr / shutdown_timer.md
Last active Jul 2, 2021
How to shutdown timer using Terminal/cmd on windows 10 and Linux & Mac OSX
View shutdown_timer.md

Initial Steps

*1) Press Windows Key + R. *2) Enter CMD and press Enter.

Execute it

Write command in the cmd:

shutdown /s /t 3600
View Free O'Reilly Books.md

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@simonhamp
simonhamp / AppServiceProvider.php
Last active Jul 4, 2022
A pageable Collection implementation for Laravel
View AppServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@leoloobeek
leoloobeek / get_gists.py
Created Apr 26, 2017
Download all gists for a specific user
View get_gists.py
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('https://api.github.com/users/{0}/gists'.format(user))
@ayubmalik
ayubmalik / es
Last active Aug 29, 2021
Bash script using Google Translate API to translate English to Spanish using curl and sed only. You can change the 'sl' and 'tl' (source/target language) query parameter to whatever you want. Optionally if you create a symlink and call it 'en' it will translate back to spanish
View es
#!/bin/bash
# uncomment and fix with appropriate values if you are behind a proxy
#export https_proxy='http://localhost:3128'
sl=en
tl=$(basename $0)
if [[ "${tl}" != "es" ]]; then
sl=es
fi
base_url="https://translate.googleapis.com/translate_a/single?client=gtx&sl=${sl}&tl=${tl}&dt=t&q="
ua='Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36'
@damir-bubanovic
damir-bubanovic / gist:d67d54b2c19aa233f51f63b3d9f0f4be
Last active Aug 6, 2018
Laravel 5 - create fake data with $faker & populate database
View gist:d67d54b2c19aa233f51f63b3d9f0f4be
<?php
/**
* SEEDING DATABASE
*
* Faker Fileds:
* https://github.com/fzaninotto/Faker
*
* 1) Create database, model, migration
* 2) artisan make:seeder
@ivanvermeyen
ivanvermeyen / !NOTE.md
Last active May 16, 2022
Setup a Laravel Storage driver with Google Drive API
View !NOTE.md
View aligning-images.md

Aligning images

left alignment

This is the code you need to align images to the left:

@archy-bold
archy-bold / ExamplePassportTest.php
Last active Jan 28, 2022
Testing Passport Authenticated Controllers and Routes in Laravel
View ExamplePassportTest.php
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ExamplePassportTest extends \PassportTestCase
{
use DatabaseTransactions;