Skip to content

Instantly share code, notes, and snippets.

View IacopoMelani's full-sized avatar
🍸

Iacopo Melani IacopoMelani

🍸
  • Italy
View GitHub Profile
@pseudomuto
pseudomuto / list.c
Created August 25, 2013 16:30
Blog Code: Implementing a Generic Linked List in C
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "list.h"
void list_new(list *list, int elementSize, freeFunction freeFn)
{
assert(elementSize > 0);
list->logicalLength = 0;
@nicolabricot
nicolabricot / deployment_key.sh
Last active June 19, 2024 03:06
Creation of Git deployment key for user www-data on Debian
# let's be root
su
# go the apache folder
cd /var/www
# create folder to store keys
mkdir .ssh
chown -R www-data:www-data .ssh
# create keys
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@solancer
solancer / apache-nginx-ftp
Created July 27, 2016 10:53
Correct permissions for /var/www/html
// Adding current user to www-data
sudo adduser $USER www-data
//change ownership to user:www-data and
sudo chown $USER:www-data -R /var/www/html
sudo chmod u=rwX,g=srX,o=rX -R /var/www/html
// change file permissions of existing files and folders to 755/644
sudo find /var/www/html -type d -exec chmod g=rwxs "{}" \;
@aamorozov
aamorozov / MediaQ.css
Last active January 9, 2024 23:36
Media Queries for mobile/tablet devices(WIP)
/*Reference:
http://www.canbike.org/CSSpixels/
https://css-tricks.com/snippets/css/retina-display-media-query/
http://stephen.io/mediaqueries/
Requires the meta viewport tag with content 'width=device-width'
For all devices with "unusual" pixel ratio i.e retina and etc include the following depending on device:
(-webkit-min-device-pixel-ratio: 1)
@vielhuber
vielhuber / readme.php
Last active June 3, 2022 11:31
passport oauth2 auth api auth authentication #laravel
/*
https://laravel.com/docs/5.5/passport
http://esbenp.github.io/2017/03/19/modern-rest-api-laravel-part-4/
https://www.youtube.com/watch?v=9i_0ia1eCdA
https://scotch.io/@neo/getting-started-with-laravel-passport
https://oauth2.thephpleague.com/authorization-server/which-grant/
*/
// add dependency to composer
composer require laravel/passport
@xavierfoucrier
xavierfoucrier / gpg-signing.md
Last active July 16, 2024 02:55
GPG signing with Git and Github Desktop

GPG signing – git github-desktop

Here is a short guide that will help you setup your environment to create signed commits or signed tags with Git locally. This has been extensively tested on Windows with Git and the Github Desktop application: I use it every day for my professional development projects.

I you face any issue, feel free to leave a comment below.

Summary

  1. Sign commits or tags
  2. Key passphrase
  3. Disable signatures
  4. Renew a GPG key