Skip to content

Instantly share code, notes, and snippets.

View arbaouimehdi's full-sized avatar
🎯
focusing

Arbaoui Mehdi arbaouimehdi

🎯
focusing
View GitHub Profile
@remy
remy / next.config.js
Created July 18, 2017 18:37
Next.js configuration for dotenv and custom servers.
const webpack = require('webpack');
require('dotenv').config({
path: process.env.NODE_ENV === 'production' ? '.env.production' : '.env'
});
module.exports = {
webpack: config => {
const env = Object.keys(process.env).reduce((acc, curr) => {
acc[`process.env.${curr}`] = JSON.stringify(process.env[curr]);
@marcelkornblum
marcelkornblum / export_repo_issues_to_csv.py
Last active December 18, 2023 20:20 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
This is strongly based on https://gist.github.com/unbracketed/3380407;
thanks to @unbracketed and the various commenters on the page.
I've mainly cleaned up the code into basic methods, and included the
various suggestions in the comments. Hope this is useful to someone.
Make sure you have `requests` and `csv` installed via pip then run it:
`python export_gh_issues_to_csv.py`
@cinghaman
cinghaman / social-share.php
Created January 19, 2017 00:51
Create your own social share buttons (use it for WordPress or simple html sites)
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<?php
global $post;
$post_url = get_permalink();
$post_title = str_replace( '', '%20', get_the_title() );
$post_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post ->ID ), 'full' );
//share URL's
$twitter_url = 'https://twitter.com/intent/tweet?text='.$post_title.'&amp;url='.$post_url.'&amp;via=twitter_id';
@aitorjs
aitorjs / uploadFile.ts
Last active March 18, 2019 20:40
Upload file using angular2 and nodejs (express)
// FRONTEND (angular2)
// product-form.compontent.html
<input type="file" (change)="fileChangeEvent($event)" placeholder="Upload file..." />
<button type="button" (click)="upload()">Upload</button>
// product-form.compontent.ts
import { Component, OnInit } from '@angular/core';
import { Http } from '@angular/http';
@Component({
@iamphilrae
iamphilrae / phpMyAdmin Export Filename Template, Including Date and Time
Last active April 3, 2024 20:30
phpMyAdmin Export Filename Template, Including Date and Time
@DATABASE@__%Y-%m-%d_%H-%M-%S
@tatemz
tatemz / docker-wpcli.sh
Last active December 18, 2020 06:59
A quick way to use one-off wp-cli commands with Docker. See Part 1: https://gist.github.com/tatemz/504383c921aa5898c49b82d4ee181362
#!/bin/bash
cd wordpress-site
cat >> docker-compose.yml <<EOL
my-wpcli:
image: tatemz/wp-cli
volumes_from:
- my-wp
links:
@Adron
Adron / install-terraform-packer-os-x.sh
Last active June 22, 2021 20:28
Install Terraform & Packer on Linux
#!/usr/bin/env bash
# Script prerequisite > install jq > https://stedolan.github.io
# ********************************************************************************************
# UPDATE: Check out Robert's repo here https://github.com/robertpeteuil/terraform-installer
# Robert's repo is more built out and has more options around the installation process.
# Cheers! -Adron
# ********************************************************************************************
cd ~
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@adeekshith
adeekshith / .git-commit-template.txt
Last active February 21, 2024 12:06 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@adrianhall
adrianhall / .eslintrc.js
Last active April 29, 2024 15:01
A sample .eslintrc file
var OFF = 0, WARN = 1, ERROR = 2;
module.exports = exports = {
"env": {
"es6": true
},
"ecmaFeatures": {
// env=es6 doesn't include modules, which we are using
"modules": true