Skip to content

Instantly share code, notes, and snippets.

View feryardiant's full-sized avatar

Fery Wardiyanto feryardiant

View GitHub Profile
sindresorhus /
Last active April 12, 2024 21:35
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
kuanghan /
Created January 3, 2019 18:41
Setting up docker to run in a PRIVILEGED LXC container

Setting up docker to run in a PRIVILEGED LXC container

Set up a privileged container

Create container

Let's call the container docker_test1.

$ sudo lxc-create -t download -n docker_test1
Follow the prompts on the screen to set up the new container.
mul14 /
Last active July 23, 2018 15:04
Delete all node_modules and bower_components directories
#!/usr/bin/env sh
find . -maxdepth 2 -type d -name node_modules -name bower_components -print0 | xargs -0 rm -rf
hok00age / Android Get Certificate Function
Last active May 7, 2022 04:08
Taruh code ini di Class Activity. Return berupa string dapat Anda masukkan di perujuk
private String getCertificate() {
String certificate = null;
PackageManager pm = this.getPackageManager();
String packageName = this.getPackageName();
int flags = PackageManager.GET_SIGNATURES;
PackageInfo packageInfo = null;
try {
packageInfo = pm.getPackageInfo(packageName, flags);
} catch (NameNotFoundException e) {
callumacrae /
Last active October 25, 2023 15:14
Build tools written in JavaScript
ericandrewlewis / gist:8290246
Last active January 2, 2016 10:29
WordPress Post Meta ideas
* Post Meta Box view/controller class.
* Extends from a form object base class.
* Creates a meta box. Fields can be related to the meta box, but
* all business logic lives within the field object.
mikemurray / Gruntfile.js
Created July 26, 2013 22:02
Gruntfile for PHP and LESS with livereloading
module.exports = function(grunt) {
pkg: grunt.file.readJSON('package.json'),
php: {
dev: {
options: {
hostname: '',
Asmod4n / html5-notifications.js
Last active June 18, 2019 22:57
A Polyfill to fix the differences in WebKit, Blink and Gecko HTML5 Desktop Notifications, also adds a way to add your own Javascript Notifications in case your Browser doesn't support them natively.
Copyright (C) 2013 Hendrik Beskow
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
JeffreyWay /
Created July 28, 2012 19:09
PHP: Set value if not exist

You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:

name = name || 'joe';

This is quite common and very helpful. Another option is to do:

name || (name = 'joe');