Skip to content

Instantly share code, notes, and snippets.

View lauborges's full-sized avatar
💭
I may be slow to respond.

Lau Borges lauborges

💭
I may be slow to respond.
View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
"type", "use", "zero-value"
"bool", "Boolean data type. It can store value `true` or `false`.", "false"
"string", "String data type. It can store UTF-8 string. All strings in go are UTF-8 by default. Unlike JavaScript, string is only encapsulated in double quotes.", "empty string"
"int", "Integer data type. It can store 32-bit or 64-bit signed integer. A 32-bit system will allocate 32 bits of memory and 64-bit system will allocate 64 bits of memory. Hence 32-bit system can store -2147483648 to 2147483647 and 64-bit system can store -9223372036854775808 to 9223372036854775807", "0"
"uint", "Integer data type. Same as `int`, `uint` can store 32 bits or 64 bits **unsigned** integer.", "0"
"int8", "Integer data type. System will allocate 8 bits of memory to store an integer. Hence it can store values between -128 to 127.", "0"
"uint8", "Integer data type. Same as `int8`, `uint8` can store 8-bit **unsigned** integer. Hence it can store values between 0 to 255.", "0"
"int16", "Integer data type. System will allocat
@superjose
superjose / .gitlab-ci.yml
Last active July 24, 2025 23:21
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
@Shourai
Shourai / namecheap SSL.md
Created October 21, 2017 12:49
Letsencrypt SSL certificate with namecheap hosting

source: https://savedlog.com/uncategorized/letsencrypt-ssl-certificate-namecheap-hosting/

The “Positive SSL” certificate I bought along with my domain is invalid with any of my subdomains and cannot be used with wildcards. One annoying thing is that namecheap doesn’t offer auto installation of free let’s encrypt certificates, even though, they are saying “Namecheap is dedicated to data security and privacy for all internet users. We believe the movement to encrypt nearly all web traffic is a positive direction. As more sites embrace HTTPS and use of security products, providers of free SSL are beginning to come online.”

Let me show you what it needs to be done in order to “encrypt nearly all web traffic”.

First, not required but it’s helpful to enable ssh access, it is not enabled by default on the base hosting plans, just go an start a live chat and request ssh access.

@rushilgupta
rushilgupta / GoConcurrency.md
Last active February 9, 2026 20:17
Concurrency in golang and a mini Load-balancer

INTRO

Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".

Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).

Let's dig in:

Goroutines

@danielkcz
danielkcz / App.js
Created September 6, 2017 12:59
Update Expo app
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Util } from 'expo'
export default class App extends React.Component {
state = {
updated: false,
}
componentWillMount() {
Util.addNewVersionListenerExperimental(() => {
/* @flow */
// Types
type ErrorCode = string | number;
type ErrorMessage = string;
// Constants
// 1. Account exists
const accountExistsCodeAndroid: ErrorCode = 'auth/account-exists-with-different-credential';
@err0r500
err0r500 / main.go
Last active May 24, 2024 02:37
gin gonic with jwt from auth0 (and CORS enabled)
package main
import (
"github.com/auth0/go-jwt-middleware"
"github.com/dgrijalva/jwt-go"
"gopkg.in/gin-gonic/gin.v1"
)
func main() {
startServer()
Dependencies:
1. Python 2.7
2. Redis
3. PostgreSQL
4. Node.js
Create virtualenv then:
pip install -r requirements.txt
pip install -r requirements_dev.txt
export class HighResolutionTimer {
private totalTicks = 0;
private timer: number | undefined;
private startTime: number | undefined;
private currentTime: number | undefined;
private deltaTime = 0;
constructor(public duration: number, public callback: (timer: HighResolutionTimer) => void) {
}
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v