Skip to content

Instantly share code, notes, and snippets.

View acfatah's full-sized avatar
🏠
Working from home

Achmad F. Ibrahim acfatah

🏠
Working from home
  • Temerloh, Pahang, Malaysia
  • 01:20 (UTC +08:00)
  • X @acfatah
View GitHub Profile
@RichardBronosky
RichardBronosky / less
Last active December 21, 2022 12:22
A vim wrapper that allow you to use it for a pager, man reader, etc.
#!/usr/bin/env bash
set -eu
cache_file="/tmp/pager.cache"
[[ ! -p "$cache_file" ]] && touch "$cache_file" && trap "rm $cache_file" 0
cat > "$cache_file"
vim -R -c "terminal cat $cache_file"
@acfatah
acfatah / github markdown syntax.md
Last active September 23, 2020 00:35 — forked from MinhasKamal/github markdown syntax.md
Markdown Syntax for GitHub.
// https://github.com/michael-ciniawsky/postcss-load-config
const purgecss = require('@fullhuman/postcss-purgecss')
const conf = require('./quasar.conf')()
const ie = conf.supportIE ? ['./node_modules/quasar/src/ie-compat/*.js'] : []
const plugins = conf.framework.plugins.map(plug => {
return `./node_modules/quasar/src/plugins/${plug}.js`
})
@joelvh
joelvh / db.rake
Last active March 18, 2023 12:04 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# Original source: https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90
# Merged with: https://gist.github.com/kofronpi/37130f5ed670465b1fe2d170f754f8c6
namespace :db do
desc 'Dumps the database to backups'
task dump: :environment do
dump_fmt = ensure_format(ENV['format'])
dump_sfx = suffix_for_format(dump_fmt)
backup_dir = backup_directory(Rails.env, create: true)
full_path = nil
cmd = nil
@santisbon
santisbon / Search my gists.md
Last active September 11, 2024 06:28
How to search gists.

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@ncochard
ncochard / babel-webpack.md
Last active September 29, 2023 05:15
The correct way to compile ES6 using babel...

When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. Is it going to be used as a dependency to a browser application (always bundled)?.
  • In cases 2) and 3) you want to allow for tree shaking.
  • In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
  • In case 3) you also want to benefit from the native support of "ES6" from your browser.
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active September 17, 2024 22:50
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@zkat
zkat / index.js
Last active July 8, 2024 04:39
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active September 20, 2024 17:38
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@angch
angch / malaysia.districts.geojson
Created March 31, 2017 11:22
geojson of malaysia's districts (mukim) converted from gadm.org for convenience
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.