Skip to content

Instantly share code, notes, and snippets.

View iwatakeshi's full-sized avatar
📚
Always learning

Takeshi iwatakeshi

📚
Always learning
View GitHub Profile
@guest271314
guest271314 / harmony.md
Last active July 8, 2024 09:13
Why I use node, deno, bun, qjs, tjs at the same time

Why I use node, deno, bun, qjs, tjs at the same time.

Winds up being a (not the) rather comprehensive JavaScript toolbox. The idea being for the modern JavaScript programmer can use all of the tools available for a given requirement, task or job, without preference for any. No external bundlers or compilers are needed. No frameworks are needed. I can use qjs or tjs for systems with minimal RAM and disk space; and when I want to use Web API's deno makes an effort to provide those interfaces. In some cases I can run the exact same code in bun, deno, and node, which provides a means to perform 1:1 testing as to performance.

There's probably a few things I am unintentionally omitting below. These are just a brief synposis. I'll update accordingly.

@agtbaskara
agtbaskara / tilix_ubuntu_guide.md
Last active April 23, 2024 14:31
Installation Guide for Tilix on Ubuntu

Install Tilix on Ubuntu 20.04

Install Tilix

sudo apt-get install tilix

Fix Tilix VTE

sudo ln -s /etc/profile.d/vte-2.91.sh /etc/profile.d/vte.sh
sudo chmod +x /etc/profile.d/vte.sh
@DreaMinder
DreaMinder / A Nuxt.js VPS production deployment.md
Last active July 13, 2024 13:46
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.

UPD: This manual now compatible with nuxt@2.3. For older versions deployment, see revision history.


Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

@delameko
delameko / iso-3166-1_codes.ex
Created May 12, 2017 11:45
ISO 3166-1 (alpha 2) country codes, in an Elixir list
country_codes = [
%{ iso_3166_1: "AF", name: "Afghanistan" },
%{ iso_3166_1: "AX", name: "Aland Islands" },
%{ iso_3166_1: "AL", name: "Albania" },
%{ iso_3166_1: "DZ", name: "Algeria" },
%{ iso_3166_1: "AS", name: "American Samoa" },
%{ iso_3166_1: "AD", name: "Andorra" },
%{ iso_3166_1: "AO", name: "Angola" },
%{ iso_3166_1: "AI", name: "Anguilla" },
%{ iso_3166_1: "AQ", name: "Antarctica" },
@iwatakeshi
iwatakeshi / scanner.js
Last active October 29, 2015 23:06
An pseudo code for mr-doc.
'use strict';
class Source {
constructor(source) {
source = source[source.length - 1] === this.EOF ?
source : source += this.EOF;
this._source = [];
for(var i = 0; i < source.length; i++) { this._source[this._source.length] = source[i]; }
this._line = 1;
@leommoore
leommoore / file_magic_numbers.md
Last active July 15, 2024 15:15
File Magic Numbers

File Magic Numbers

Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.

For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.

This gives an ongoing list of file-type magic numbers.

Image Files

@iwatakeshi
iwatakeshi / library.js
Created November 16, 2014 04:50
Javascript library template for the Browser and Node.js Bootstrap
/*jslint node: true, forin: true, jslint white: true, newcap: true*/
/*
* library
* author : Takeshi Iwana
* https://github.com/iwatakeshi
* license : MIT
* Code heavily borrowed from Adam Draper
* https://github.com/adamwdraper
*/
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.
@wilmoore
wilmoore / array-early-exit-options.js
Last active February 22, 2017 05:27
Array iteration early exit options -- best options are lodash.forEach or Array#some.
/**
* Use `Array#some` when it is convenient to exit on truthy return values
* Use `lodash.forEach` when it is convenient to exit on false (you can cast if necessary with `!!`)
*/
var _ = require('lodash');
var numbers = [1, 2, 3, 4, 5, 6];
console.log('Array#forEach (result not as expected)');