Skip to content

Instantly share code, notes, and snippets.

View wowselim's full-sized avatar
🐌

Selim Dinçer wowselim

🐌
View GitHub Profile
@wowselim
wowselim / build.gradle.kts
Created May 10, 2023 10:29
Vert.x + Kotlin + JTE + HTMX
plugins {
id("gg.jte.gradle") version "2.2.2"
}
jte {
precompile()
}
tasks.withType<ProcessResources> {
dependsOn(tasks.withType<CompileSass>())
@wowselim
wowselim / x.c
Created December 19, 2018 09:16
PutInt
void putint(int zahl) {
char result[12];
result[11] = '\0';
bool negative = zahl < 0;
zahl = abs(zahl);
int i = 10;
for(; i > 0 && zahl != 0; i--) {
result[i] = (zahl % 10) + '0';
@wowselim
wowselim / Receiver.java
Created February 12, 2017 15:38
fairly efficient file transfer in java
package co.selim.filetransfer.receiver;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
public class Receiver {
public static void main(String[] args) throws Exception {
@wowselim
wowselim / main.cpp
Created February 1, 2017 14:17
count lines of code in directory in cpp
#include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#include "tinydir.h"
inline std::string trim(const std::string &s) {
auto wsfront = std::find_if_not(s.begin(), s.end(), [](int c) { return std::isspace(c); });
auto wsback = std::find_if_not(s.rbegin(), s.rend(), [](int c) { return std::isspace(c); }).base();
import java.util.Scanner;
public class Rechner {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Zahl 1: ");
int a = Integer.parseInt(sc.nextLine());
System.out.print("Zahl 2: ");
int b = Integer.parseInt(sc.nextLine());
System.out.print("Operation: ");
import java.util.Arrays;
public class WeirdBubbleSort {
public static void main(String[] args) {
int[] array = new int[] { 5, -13, 7, 3, 4, 2 };
sort(array);
System.out.println(Arrays.toString(array));
}
public static void sort(int[] array) {
package main
import (
"fmt"
)
func main() {
var foo [1000]int
var value = 400
package main
import (
"fmt"
)
func main() {
foo := [...]int{ 5, 2, 623, 73, 3424, 6, 1, 672 }
// make slice out of foo
public class ScrabbleWordTester {
public static void main(String[] args) {
char[] chars = { 'a', 'u', 'b', 'm' };
System.out.println(charsCanBuildString(chars, "baum"));
System.out.println(charsCanBuildString(chars, "muab"));
System.out.println(charsCanBuildString(chars, "ab"));
System.out.println(charsCanBuildString(chars, "babo"));
System.out.println(charsCanBuildString(chars, ""));
}
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class TextSplitter {
public static void main(String[] args) {
// These are just two lines that you have read from a file:
String firstLine = "hello? bartender. can I have a drink!whiskey please.";
String secondLine = "another. line.";