Skip to content

Instantly share code, notes, and snippets.

View cikaldev's full-sized avatar
😷
stay health

Ian Cikal cikaldev

😷
stay health
View GitHub Profile
@cikaldev
cikaldev / main.go
Created November 6, 2021 17:57 — forked from mschoebel/main.go
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling
@cikaldev
cikaldev / portfinder.md
Created November 9, 2021 01:39 — forked from loilo/portfinder.md
Find Free Port with PHP

Find Free Port with PHP

This is a quick way to find a random free port on a system using PHP:

$port = find_free_port();

Benchmarked locally, where finding a port always took around 0.15ms.

@cikaldev
cikaldev / git-deployment.md
Created March 24, 2022 08:29 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@cikaldev
cikaldev / spleeter.cmd
Last active February 23, 2025 15:07 — forked from CapsAdmin/spleeter.cmd
This makes it possible to run spleeter without having to install pyton and pip on windows. See http://github.com/deezer/spleeter for more info on what spleeter is. Usage is `.\spleeter.cmd separate -p spleeter:5stems -o amen .\amenbrother.wav`
@echo off & set GOLUWA_START_TIME="%time%" & PowerShell -nologo -noprofile -noninteractive Invoke-Expression ('$args=(''%*'').split('' '');'+'$PSScriptRoot=(''%~dp0'');$env:GOLUWA_CURRENT_DIRECTORY=(''%cd%'');'+((Get-Content -Raw '%~dp0%~n0%~x0' ) -Replace '^.*goto :EOF')); & goto :EOF
# ^^^^^
# this is some magic to execute the rest of this cmd as powershell
# so we can run it from explorer with double click or cmd easily
function Download($url, $location) {
Write-Host -NoNewline "'$url' >> '$location' ... "
(New-Object System.Net.WebClient).DownloadFile($url, "$location")
Write-Host "OK"
@cikaldev
cikaldev / app.js
Created April 6, 2023 16:55 — forked from jgoux/app.js
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@cikaldev
cikaldev / Track Download Progress in node.js
Created May 25, 2023 20:45 — forked from J-Cake/Track Download Progress in node.js
This script records progress made over download without using the `pipe` function and is incredibly memory efficient.
const http = require('http');
const fs = require('fs');
const path = require('path');
const fileLocation = path.join(__dirname, 'video.mp4');
fs.writeFileSync(fileLocation, '');
const file = fs.createWriteStream(fileLocation);
function printSize(bytes) {
@cikaldev
cikaldev / Sublime Text 3 (Build 3211) license key.md
Created June 25, 2023 23:10 — forked from rajibdpi/Sublime Text 3 (Build 3211) license key.md
Sublime Text 3 (Build 3211) 100% working License Key.