Skip to content

Instantly share code, notes, and snippets.

View darrensapalo's full-sized avatar

Darren darrensapalo

View GitHub Profile
@darrensapalo
darrensapalo / connection.js
Created October 11, 2019 12:06
sequelize connection not working for MSSQL
"use strict";
const crypto = require('crypto');
const os = require('os'); // $FlowFixMe
const constants = require('constants');
const _require = require('tls'),
@darrensapalo
darrensapalo / Gitlab-runner-register.fish
Created September 18, 2019 04:18
Interactive process for registering a gitlab runner.
#! usr/local/bin/fish
# My preferred executor type is docker.
set executorType docker
# My preferred docker image is node 10.16.
set dockerImage node:10.16.2-jessie
# Helper utility function to confirm choices.
# https://stackoverflow.com/questions/16407530/how-to-get-user-confirmation-in-fish-shell
@darrensapalo
darrensapalo / for-ionic-projects.sh
Created September 13, 2019 03:30
one line CLI command to change `compile` into `implementation` on your android projects
sed -i '' 's/compile /implementation /g' platforms/android/app/build.gradle
@darrensapalo
darrensapalo / standard_ups_and_downs.json
Created September 2, 2019 14:58
Data for my Growth article
[{"index":0,"value":0,"name":"standard"},{"index":1,"value":0.008118586489613184,"name":"standard"},{"index":2,"value":0.0160921426061105,"name":"standard"},{"index":3,"value":0.0237785927496526,"name":"standard"},{"index":4,"value":0.031041710667941577,"name":"standard"},{"index":5,"value":0.03775389485892593,"name":"standard"},{"index":6,"value":0.04379876825733662,"name":"standard"},{"index":7,"value":0.04907354924039483,"name":"standard"},{"index":8,"value":0.0534911456470562,"name":"standard"},{"index":9,"value":0.05698192914833425,"name":"standard"},{"index":10,"value":0.0594951538186062,"name":"standard"},{"index":11,"value":0.060999990006668406,"name":"standard"},{"index":12,"value":0.06148615244299108,"name":"standard"},{"index":13,"value":0.060964109786442025,"name":"standard"},{"index":14,"value":0.05946487134128409,"name":"standard"},{"index":15,"value":0.05703935528976252,"name":"standard"},{"index":16,"value":0.05375735131158291,"name":"standard"},{"index":17,"value":0.04970609872532978,"name":"
@darrensapalo
darrensapalo / Using pdfkit
Last active March 14, 2019 13:00
fs.readFileSync is undefined.md
I've been using pdfkit and have been encpuntering # Pdfkit
I've been using pdfkit and have been encountering this problem that says:
```
fs.readFileSync is undefined.
```
It took me a while to understand what the whole problem was, so let me walk you through my experience.
I needed a pdf generator on my ionic 3, angular 5 cross platform mobile app.
@darrensapalo
darrensapalo / DailyReward.txt
Created December 21, 2018 16:34
Updated Stolao's daily reward script to work for Hercules server
//===== EinherjarRO Scripts ==================================
//= Requested
//===== By: ==================================================
//= Stolao
//===== Current Version: =====================================
//= 2.1D
//===== Compatible With: =====================================
//= Hercules
//===== Description: =========================================
//= A reward system for players who play more frequently
@darrensapalo
darrensapalo / dataset.txt
Created September 25, 2018 16:37
Growth tracking
{"date":"2018-09-26T00:13:09+08:00","small_wins":366,"right":51}
{"date":"2018-09-24T22:01:34+08:00","small_wins":355,"right":51}
{"date":"2018-09-24T08:47:18+08:00","small_wins":338,"right":49}
{"date":"2018-09-22T23:23:49+08:00","small_wins":292,"right":46}
{"date":"2018-09-22T17:06:17+08:00","small_wins":286,"right":45}
%%% This output was generated by the following command:
%%% /home/gingerbeard/candc/bin/boxer --stdin --semantics fol
%%% I want food
id(1,1).
fol(1,some(A,and(n1person(A),some(B,some(C,and(r1theme(B,C),and(r1agent(B,A),and(v1want(B),n1food(C))))))))).
First order logic representation
There exists some A
@darrensapalo
darrensapalo / diagnosis.md
Created December 7, 2017 03:23
Hot Module Replacement for Vue.js and Express

Notes on _cluster2.setupMaster is not a function issue.

I encountered this same problem.

My stack is: Vue.js (2.5.0), Express (4.16.2). Following this tutorial for React + Node.js, I was trying to do the same but for vuejs.

Changes to the file server were detected by the client process; webpack was able to compile it properly, but the server runs into this problem after running the two processes in parallel.

_cluster2.default.setupMaster is not a function

@darrensapalo
darrensapalo / rxswift3networkcalltoobject
Last active July 8, 2019 15:20
Swift 3 example of a network request wrapped as an RxSwift Observable and converted into a class object
import Foundation
import RxSwift
let networkQueue = DispatchQueue(label: "com.appName.networkQueue")
class Queue {
var name: String
public init (_ name: String) {
self.name = name