Skip to content

Instantly share code, notes, and snippets.

View ezra-obiwale's full-sized avatar
🏠
Working from home

Ezra Obiwale ezra-obiwale

🏠
Working from home
  • DScribe Technologies
  • Lagos, Nigeria
View GitHub Profile
@yougg
yougg / hibernate.md
Last active December 16, 2020 04:16
Ubuntu 19.04 enable hibernate

Enable hibernate with swapfile on Ubuntu 19.04

Install hibernate and other dependencies which are needed to hibernate

sudo apt install hibernate

Create the swap file

@alexey-kar
alexey-kar / download-file.js
Last active April 19, 2023 16:27
Download files with AJAX (axios) / Download files with AJAX (Laravel)
// use responseType: 'blob'
axios({
url: 'http://localhost/download_pdf',
method: 'GET',
responseType: 'blob', // <--
}).then(response => {
const blob_file = response.data;
const file_url = URL.createObjectURL(blob_file);
window.open(file_url); // open file in new tab
});
@ezra-obiwale
ezra-obiwale / cloudSettings
Last active September 19, 2021 10:31
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-09-19T10:31:20.586Z","extensionVersion":"v3.4.3"}
@tokland
tokland / escape-xpath-string.js
Last active March 31, 2022 23:07
Escape xpath string using concat
function escapeXpathString(str) {
const splitedQuotes = str.replace(/'/g, `', "'", '`);
return `concat('${splitedQuotes}', '')`;
}
@mentos1386
mentos1386 / Webstorm-Airbnb-Javascript-codeStyle.xml
Created March 12, 2017 11:03
Airbnb inspired Webstorm Javascript CodeStyle
<code_scheme name="Airbnb">
<option name="RIGHT_MARGIN" value="100" />
<option name="HTML_ATTRIBUTE_WRAP" value="4" />
<option name="HTML_ELEMENTS_TO_INSERT_NEW_LINE_BEFORE" value="" />
<option name="HTML_ENFORCE_QUOTES" value="true" />
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
@sdrew
sdrew / Procfile
Last active July 27, 2021 15:25
Laravel configs for Heroku/Dokku
web: vendor/bin/heroku-php-apache2 public/
@Jamesits
Jamesits / caddy.sh
Last active January 27, 2024 14:47
Install Caddy Server on Ubuntu with Systemd.
# Should work on all Debian based distros with systemd; tested on Ubuntu 16.04+.
# This will by default install all plugins; you can customize this behavior on line 6. Selecting too many plugins can cause issues when downloading.
# Run as root (or sudo before every line) please. Note this is not designed to be run automatically; I recommend executing this line by line.
apt install curl
curl https://getcaddy.com | bash -s personal dns,docker,dyndns,hook.service,http.authz,http.awses,http.awslambda,http.cache,http.cgi,http.cors,http.datadog,http.expires,http.filemanager,http.filter,http.forwardproxy,http.geoip,http.git,http.gopkg,http.grpc,http.hugo,http.ipfilter,http.jekyll,http.jwt,http.locale,http.login,http.mailout,http.minify,http.nobots,http.prometheus,http.proxyprotocol,http.ratelimit,http.realip,http.reauth,http.restic,http.upload,http.webdav,net,tls.dns.auroradns,tls.dns.azure,tls.dns.cloudflare,tls.dns.cloudxns,tls.dns.digitalocean,tls.dns.dnsimple,tls.dns.dnsmadeeasy,tls.dns.dnspod,tls.dns.dyn,tls.
@wojteklu
wojteklu / clean_code.md
Last active May 5, 2024 22:20
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@jjsquady
jjsquady / docker-compose.yml
Created September 9, 2016 01:22
Docker compose for Vuejs Projects
version: '2'
services:
#------------------------------------------------------------
# Web server - For live reload and development
# This environment can be used to run npm and node
# commands as well
# Credits: http://github.com/codecasts/ambientum
#------------------------------------------------------------
dev:
@kfriend
kfriend / respond_and_process.php
Created March 11, 2016 01:35
PHP: Send response and continue processing
<?php
// Buffer all upcoming output...
ob_start();
// Send your response.
echo "Testing response";
// Get the size of the output.
$size = ob_get_length();