Skip to content

Instantly share code, notes, and snippets.

View nihat-js's full-sized avatar
📑
Reading Documentation ...

Nihat nihat-js

📑
Reading Documentation ...
View GitHub Profile
@nihat-js
nihat-js / reset.css
Created January 13, 2023 17:56
Reset CSS
*{
margin:0;
padding:0;
box-sizing:border-box;
text-decoration:none;
list-style : none;
font-family : 'apple'
}
a{
@mixin breakpointt ($size : 'sm') {
$all : (sm : "320px",
md :"768px",
lg : "1200px",
);
@if (map-has-key($all, $size )) {
$size : map-get($all, $size );
@media screen and (min-width: $size ) {
CREATE TABLE users (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE photos (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
image_url VARCHAR(255) NOT NULL,
user_id INTEGER NOT NULL,
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
public class MyServer {
public class ZombieThreadTester {
public static void main(String[] args) {
Thread z1 = new Thread(new ZombieThread("WINDOWS"));
Thread z2 = new Thread(new ZombieThread("LINUX"));
Thread z3 = new Thread(new ZombieThread("UNIX"));
Thread z4 = new Thread(new ZombieThread("UNIX"));
System.out.println("Active Count"+Thread.activeCount());
public class ZombieThreadTester {
public static void main(String[] args) {
Thread[] threads = new Thread[100];
for (int i = 0; i < 100; i++) {
threads[i] = new Thread(new MyRunnable(i));
}
for (int i = 0; i < 100; i++) {
threads[i].start();
@nihat-js
nihat-js / User.model.js
Created December 13, 2023 22:34
mongoose-user-schema
const mongoose = require("mongoose")
const userSchema = new mongoose.Schema({
username: { type: String, required: true, unique: true, maxLength: 32, },
email: { type: String, required: true, unique: true, maxLength: 255, },
phone: { type: Number, default: null, },
password: { type: String, required: true, },
is_email_verified: { type: Boolean, default: false },
is_phone_verified: { type: Boolean, default: false },
is_private: { type: Boolean, default: false, },
register_info: { type: Object, required: true },
@nihat-js
nihat-js / ikincfil.e
Created February 7, 2024 17:00
elave melumat
‎‎​
$("#admin_basket_check_all").on("change",function(){
if ($(this).is(":checked")){
$("tbody [type='checkbox']").prop("checked",true)
}else{
$("tbody [type='checkbox']").prop("checked",false)
}
})
$(document).on("change","tbody [type='checkbox']",function(){
let isAllChecked = $("tbody input:checked").length === $("table tbody input:not(:checked)").length
alert(JSON.stringify(localStorage))
console.log("should work")