Skip to content

Instantly share code, notes, and snippets.

View Nakira's full-sized avatar

Jean-Charles van der Bruggen Nakira

View GitHub Profile
@oodavid
oodavid / README.md
Last active March 11, 2025 21:41 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@aquelito
aquelito / git-command.md
Last active June 18, 2025 15:16
GIT - Ligne de commande principale
title category
Git config
Git

Rappel

Ne pas oublier : l'aide en ligne de commande.

@niksumeiko
niksumeiko / git.migrate
Last active July 1, 2025 18:41
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@shime
shime / _readme.md
Last active April 28, 2023 18:56
github oauth in node using express

What?

Most basic example of authenticating with Github in node.

How?

Clone this gist, change keys inside config.js and then hit npm install && node app.js.

Done?

@vasildakov-zz
vasildakov-zz / Module.php
Last active November 21, 2021 05:32
ZF2 and Doctrine Entity listeners resolver
<?php
namespace Application;
class Module
{
public function onBootstrap(MvcEvent $e)
{
$application = $e->getTarget();
$serviceManager = $application->getServiceManager();
$sharedManager = $application->getEventManager()->getSharedManager();
@attilahorvath
attilahorvath / dump_restore_mysql_utf8mb4.sh
Created March 13, 2015 13:33
Dump/restore MySQL database with utf8mb4 encoding
# dump
mysqldump -u user -p database --default-character-set=utf8mb4 --result-file=dump.sql
# restore
mysql -u user -p database < dump.sql
@phindmarsh
phindmarsh / FacebookGrant.php
Last active July 2, 2016 16:20
Facebook Grant Type
<?php
namespace MyApp\OAuth2\GrantType;
use Facebook\FacebookRequest;
use Facebook\FacebookSession;
use Facebook\GraphUser;
use OAuth2\RequestInterface;
use OAuth2\ResponseInterface;
use OAuth2\Storage\ClientCredentialsInterface;
use OAuth2\Storage\AccessTokenInterface;
@harryfinn
harryfinn / wp-cli-migrate-db.md
Created March 24, 2016 11:59
WP-CLI DB migrate instructions

Instructions for using WP-CLI to migrate a WordPress DB

# Export current (local) DB
wp db export db.sql

# Copy file from local to server (may need to amend server path if not in html folder)
# The example below is for local to remote, simply swap these 2 around for remote to local
scp -r db.sql www-data@IP_ADDRESS:/var/www/html

# SSH onto box (should be same connection details as above)
@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active December 8, 2024 22:08
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@Lego2012
Lego2012 / htaccess-yo-jekyll
Last active March 11, 2021 00:46
htaccess - You Jekyll Generator #htaccess #jekyll
# Apache Configuration File
# (!) Using `.htaccess` files slows down Apache, therefore, if you have access
# to the main server config file (usually called `httpd.conf`), you should add
# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
# ##############################################################################
# # CROSS-ORIGIN RESOURCE SHARING (CORS) #
# ##############################################################################