Skip to content

Instantly share code, notes, and snippets.

View kidandcat's full-sized avatar
☀️
Looking for the place of sunrise

Hairok kidandcat

☀️
Looking for the place of sunrise
View GitHub Profile
# Excluded commands to overwrite in PowerShell
$exclude = @("dir", "cd", "git", "node", "tsc", "magic", "npm", "code", "vsce", "set", "go", "jasmine", "flow", "parcel")
Set-PSReadlineKeyHandler -Key Tab -Function Complete
function bashFunc($cmd, $arg) {C:\windows\system32\bash.exe -c "sudo $cmd $arg"}
$MaximumFunctionCount = 30000
$pat = "^[a-zA-Z0-9\s]+$"
$cmds = bash -c "compgen -ac"
$ErrorActionPreference = "SilentlyContinue"
foreach ($c in $cmds) {
@kidandcat
kidandcat / prime.go
Last active May 30, 2018 10:25
go run prime.go NumberOfDigits
package main
import (
"fmt"
"os"
"strconv"
)
func main() {
// RSA-2048 is a decimal number of 617 digits
(()=>{S=String.fromCharCode,W=((...r)=>window[S(...r)]),em=(e=>(r=e[S(109,97,116,99,104)](/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi),r)),l=W(99,111,110,115,111,108,101)[S(108,111,103)],pt=(S=>{S&&l(S.join(" "))});for(var e,o=W(100,111,99,117,109,101,110,116)[S(99,114,101,97,116,101,84,114,101,101,87,97,108,107,101,114)](W(100,111,99,117,109,101,110,116)[S(98,111,100,121)],NodeFilter.SHOW_TEXT,null,!1);e=o.nextNode();)pt(em(e[S(116,101,120,116,67,111,110,116,101,110,116)]))})();
package main
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"log"
"os"
function uuidv4() {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
)
}
import Control.Monad (forM_, when)
import Control.Monad.ST
import Data.Array.ST
import Data.Array.Unboxed
import System.Environment
sieve :: Int -> UArray Int Bool
sieve n = runSTUArray $ do
let m = (n-1) `div` 2
r = floor . sqrt $ fromIntegral n

Keybase proof

I hereby claim:

  • I am kidandcat on github.
  • I am kidandcat (https://keybase.io/kidandcat) on keybase.
  • I have a public key ASD98swS2LH5OPYFa-Ym7jU1FRgniyQU0KGgiRsDzo4Hhwo

To claim this, I am signing this object:

@kidandcat
kidandcat / server.nim
Created April 15, 2019 14:40
Server in Nim
import asynchttpserver, asyncdispatch, json
var server = newAsyncHttpServer()
proc handler(req: Request) {.async.} =
case req.url.path:
of "/hello-world":
let msg = %* {"message": "Hello World"}
let headers = newHttpHeaders([
("Content-Type","application/json"),
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
const member = data.results.members[j]
function crearCelda(memberData, campo){ // necesitamos recibir memberData para poder coger el valor de la propiedad
// Repetir este bloque por cada celda de informacion que queremos meter en la fila
let td = document.createElement("td");
// añadimos informacion del miembro a la celda (td -> table data)
td.innerHTML = memberData[campo] // Cogemos la propiedad que haya en la variable campo
// añadimos esa celda a la fila que tenemos (tr -> table row)
return td //devolvemos el td
}