Skip to content

Instantly share code, notes, and snippets.

View cihangir-mercan's full-sized avatar

cihangir mercan cihangir-mercan

View GitHub Profile
import React, { useState, useCallback, useRef } from "react";
import { DndProvider, useDrag, useDrop } from "react-dnd";
import HTML5Backend from "react-dnd-html5-backend";
import update from "immutability-helper";
const tasksList = [
{ _id: 1, title: "First Task", status: "backlog" },
{ _id: 2, title: "Second Task", status: "backlog" },
{ _id: 3, title: "Third Task", status: "backlog" },
{ _id: 4, title: "Fourth Task", status: "new" },
@rwoloszyn
rwoloszyn / controllers.js
Created June 27, 2016 17:19
Add checkbox as control in leaflet map
// create the control
var autoZoomCheckbox = L.control({position: 'topleft'});
autoZoomCheckbox.onAdd = function (map) {
var div = L.DomUtil.create('div', 'command');
div.innerHTML = '<form><input id="command" type="checkbox"/>Automatic fit to bounds</form>';
return div;
};
autoZoomCheckbox.addTo(map);
@eburhan
eburhan / tcno_dogrula.js
Last active October 23, 2025 15:47
javascript ile TC Kimlik Numarası doğrulama (1 döngü kullanılarak)
/* tc kimlik numarasının geçerli olup olmadığını kontrol eder
* 2015 Erhan BURHAN
*--------------------------------------------------------------------*/
function tcno_dogrula(tcno)
{
// geleni her zaman String'e çevirelim!
tcno = String(tcno);
// tcno '0' karakteri ile başlayamaz!
if (tcno.substring(0, 1) === '0') {
@gabrielemariotti
gabrielemariotti / README.md
Last active May 3, 2025 05:23
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

@RequestMapping(value = "/guests/{surname}", method = RequestMethod.GET)
public String showGuestList(Model model, @PathVariable("surname") String surname) {
model.addAttribute("guests", hotelService.getGuestsList(surname));
return "results :: resultsList";
}
@RequestMapping(value = "/guests", method = RequestMethod.GET)
public String showGuestList(Model model) {
model.addAttribute("guests", hotelService.getGuestsList());