Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Carlos W. Mercado carloswm85

🎯
Focusing
View GitHub Profile
@carloswm85
carloswm85 / norepaint.js
Last active Aug 16, 2022
Saved as .js just for adding some color to it. No repainting function for Pinescript 5.0
View norepaint.js
//@version=5
// === No repainting.
f_nrp(_timeframe, _expression) =>
// request.security(symbol=syminfo.tickerid, timeframe=_timeframe, expression=_expression[barstate.isrealtime ? 1 : 0], gaps=barmerge.gaps_off)[barstate.isrealtime ? 0 : 1] // PineCoders best practice.
request.security(symbol=syminfo.tickerid, timeframe=_timeframe, expression=_expression[1], lookahead = barmerge.lookahead_on)
// Use
ema_expression = ta.ema(low, ema_length)
// Get values using anti-repainting
View select2Example.js
$(document).ready(function () {
// Variable assignment
var $producerSelect = $('#ProducersId');
$producerSelect.on('select2:select', function (e) {
var data = e.params.data;
var idPerson = data.id;
var dataWrapper = {
View w9-sql-summary-queries-exercise3_solution.md

This is the solution. Be sure that you've spent a good chanck of your time trying out your own approaches before using this solution.

-- 3. How many of each category of bikes do we have in our "Baldwin Bikes" store, which has the store_id of 2.
-- We need to see the name of the category as well as the number of bikes in the category.
-- Sort it by lowest numbers first. 
USE bike;
USE bike;
SELECT * FROM category;
SELECT * FROM product;
@carloswm85
carloswm85 / proxyswitcher.sh
Created Jun 8, 2022
Bash script functions for quickly setting and unsetting proxy configurations. Includes examples.
View proxyswitcher.sh
function proxy {
YW='\033[0;33m' # Yellow
NC='\033[0m' # No Color
SB='\033[1;34m' # Sky Blue
PP='\033[1;35m' # Purple
printf "\n${YW}How to set and unset proxy using Git Bash: ${NC}"
printf "\n${PP}Check:"
printf "\n${NC} $ git config --global --list"
printf "\n${PP}SET (Example):"
printf "\n${NC} $ http.proxy=http://username:password@proxyaddress:port"
View gist:8d570b1fbcba3dab6bc57a88d8b17f8b
Starting OmniSharp server at 5/20/2022, 10:58:08 AM
Target: c:\Users\carlo\source\repos\carloswm85-github\Ex_Files_C_Sharp_EssT_1\Exercise Files\CH02\02\Begin\LinkedIn.Essentials\LinkedIn.Essentials
OmniSharp server started.
Path: c:\Users\carlo\.vscode\extensions\ms-dotnettools.csharp-1.24.4-win32-x64\.omnisharp\1.38.3-beta.87\OmniSharp.exe
PID: 13440
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
View gist:891a1f973535fbea83ad351fa3cddbbd
Severity Code Description Project File Line Suppression State
Error CS0426 The type name 'Collections' does not exist in the type 'System' MiningGuide.Data C:\Users\carlo\source\repos\guiaminera\MiningGuide\MiningGuide.Data\Model\Contacto.cs 13 Active
Error CS0138 A 'using namespace' directive can only be applied to namespaces; 'System' is a type not a namespace. Consider a 'using static' directive instead MiningGuide.Data C:\Users\carlo\source\repos\guiaminera\MiningGuide\MiningGuide.Data\Model\Expediente.cs 12 Active
Error CS0426 The type name 'Collections' does not exist in the type 'System' MiningGuide.Data C:\Users\carlo\source\repos\guiaminera\MiningGuide\MiningGuide.Data\Model\Expediente.cs 13 Active
Error CS0426 The type name 'Diagnostics' does not exist in the type 'System' MiningGuide.Data C:\Users\carlo\source\repos\guiaminera\MiningGuide\MiningGuide.Data\Model\Expediente.cs 17 Active
Error CS0246 The type or namespace name 'Nullable<>' could not be found (are you missing a using directive or an as
View anti-scammers-guide.md
View signature-binance-api-sha256-function-vanilla-javascript.md
View w9-sql-summary-queries.md
@carloswm85
carloswm85 / cors-nightmare.md
Last active Dec 15, 2021
Trying to implement bypass CORS Chrome browser policy in a Vanilla JS Binance API small project. Using node-fetch.
View cors-nightmare.md

I've had a really bad time looking for a solution for this. The only thing that I was able to make for for getting the listening key, was adding this extension to my browser https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf/related?hl=es

I came across some other solutions, like some extra dependencies (axios, for example) or running a proxy server (light-server,or lite-server, or some nodejs-proxy-server), but I was not able to make those work in time really.

For what I was able to see, this CORS policy is a big issue for developers. https://www.youtube.com/results?search_query=cors+javascript+fetch

With that extension I was able to get some information about the Request and Response given to/from the server using DevTools from Chrome. Do you think it may be possible to get some information from those headers I can use in my raw code? So I can get rid of that extension. I tried to use some of the key-value pairs I considered to be part of the solution, eve