Skip to content

Instantly share code, notes, and snippets.

View lumentut's full-sized avatar

Yohanes lumentut

View GitHub Profile
{
"Meta Data": {
"1. Information": "Daily Time Series with Splits and Dividend Events",
"2. Symbol": "SPY",
"3. Last Refreshed": "2023-03-24",
"4. Output Size": "Compact",
"5. Time Zone": "US/Eastern"
},
"Time Series (Daily)": {
"2023-03-24": {
@lumentut
lumentut / countries.json
Created August 14, 2022 05:54 — forked from erdem/countries.json
Country list as JSON format. fields: name, coordinates, timezones, country code and capital resource: https://github.com/mledoze/countries
[
{
"timezones": [
"America/Aruba"
],
"latlng": [
12.5,
-69.96666666
],
"name": "Aruba",
class DataTypes
def initialize
@columns = {}
end
def columns
@columns
end
def col(name, args)
@lumentut
lumentut / data_types.rb
Created July 9, 2021 09:41
Data types principle
class DataTypes
def col(name, args)
puts name
puts args
end
end
class Test
def column_defs(&block)
yield DataTypes.new
@lumentut
lumentut / password.js
Last active May 27, 2021 23:06
strapi custom password reset
'use strict';
/**
* api/password/controllers/password.js
*/
const { sanitizeEntity } = require('strapi-utils');
const formatError = error => [
{ messages: [{ id: error.id, message: error.message, field: error.field }] },
];
SQL> select column_name, column_def from sysibm.sqlcolumns where table_name='BOOKS' and table_schem='LIBTEST'
+---------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| COLUMN_NAME | COLUMN_DEF |
+---------------------------------------------
irb(main):001:0> DB.connect
/home/yohanes/Projects/libs/odbc_test/lib/odbc_test.rb:10: [BUG] Segmentation fault at 0x000055a595665f8f
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0021 p:---- s:0102 e:000101 CFUNC :fetch_all
c:0020 p:0023 s:0098 e:000097 METHOD /home/yohanes/Projects/libs/odbc_test/lib/odbc_test.rb:10
c:0019 p:0010 s:0092 e:000091 EVAL (irb):1 [FINISH]
c:0018 p:---- s:0089 e:000088 CFUNC :eval
c:0017 p:0021 s:0081 e:000080 METHOD /home/yohanes/.rbenv/versions/2.6.5/lib/ruby/2.6.0/irb/workspace.rb:85
function solution(N) {
// Convert number to a binary string
const binString = (N >>>0).toString(2)
// Remove trailing zeros from the string
while(binString.slice(-1) === "0") {
binString = binString.slice(0,-1)
}
// Get gaps array by using split(1) then remove "" from the array