Skip to content

Instantly share code, notes, and snippets.

@gp187
gp187 / j.ts
Last active March 22, 2024 14:06
PO formatting
const x = {
salesOrders: {
description: `sales orders ...`,
data: [
{
date: '2014-09-21',
totalWithTax: 23,
totalTax: 23,
totalShipping: 12
}
@gp187
gp187 / currencies.json
Created February 9, 2017 12:32
All currencies in JSON -- Array of Objects
[{
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
}, {
"symbol": "CA$",
@gp187
gp187 / webstorm-phpstorm-inotify-fix
Last active June 13, 2023 08:56
Webstorm, PHPStorm Inotify watch limit is too low
To prevent this situation it is recommended to increase the watches limit (to, say, 512K):
1. Add the following line to either /etc/sysctl.conf file or a new *.conf file (e.g. idea.conf) under /etc/sysctl.d/ directory:
fs.inotify.max_user_watches = 524288
2. Then run this command to apply the change:
sudo sysctl -p --system
And don't forget to restart your IDE.
@gp187
gp187 / README.md
Created April 18, 2023 02:00
ChatGPT plugin
  1. Instal NestJS
  2. Create new controller using the sample
  3. Add the 2 files in to the root
  4. Use ngrok to port forward to https
  5. Install plugin
@gp187
gp187 / plug
Created January 26, 2023 17:18
plug
class OpenAiBobPlugin {
public foo() {
return 'bar';
}
public init(): string {
return 'initi'
}
@gp187
gp187 / linkedin-industry-codes.json
Created February 9, 2017 14:03
LinkedIn Full Industry Codes in JSON
[
{"Code": 47,"Groups": "corp, fin","Description": "Accounting"},
{"Code": 94,"Groups": "man, tech, tran","Description": "Airlines/Aviation"},
{"Code": 120,"Groups": "leg, org","Description": "Alternative Dispute Resolution"},
{"Code": 125,"Groups": "hlth","Description": "Alternative Medicine"},
{"Code": 127,"Groups": "art, med","Description": "Animation"},
{"Code": 19,"Groups": "good","Description": "Apparel & Fashion"},
{"Code": 50,"Groups": "cons","Description": "Architecture & Planning"},
{"Code": 111,"Groups": "art, med, rec","Description": "Arts and Crafts"},
{"Code": 53,"Groups": "man","Description": "Automotive"},
@gp187
gp187 / site.conf
Created August 21, 2020 12:52
Nginx website with Ghost blog in a subdirectory sharing a single SSL
server {
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name domain.tld www.domain.tld;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
{
"type": "fulltext-index",
"name": "idx_listContactsSearch",
"uuid": "2394267d30241ef1",
"sourceType": "couchbase",
"sourceName": "contacts",
"sourceUUID": "b6f199faacce42c00290423d23f1e9a2",
"planParams": {
"maxPartitionsPerPIndex": 171,
"indexPartitions": 6
@gp187
gp187 / Dockerfile
Last active April 16, 2020 15:35
pipeline.yaml
FROM node:12.15.0
LABEL maintainer="Naologic <contact@naologic.com>"
# Make the dir
RUN mkdir -p /var/nao
RUN mkdir -p /etc/pm2-web
WORKDIR /var/nao
# Bundle APP files
COPY dist dist/
@gp187
gp187 / matomo.conf
Created July 8, 2019 08:58
nginx conf for matomo
upstream php-handler {
server app:9000;
}
server {
listen 80;
add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance
root /var/www/html; # replace with path to your matomo instance
index index.php;