Skip to content

Instantly share code, notes, and snippets.

View firatkucuk's full-sized avatar
🍉

Fırat Küçük firatkucuk

🍉
View GitHub Profile
@firatkucuk
firatkucuk / Dockerfile
Created February 11, 2022 18:20
containers101
FROM node:10
ADD server.js server.js
EXPOSE 8080
CMD [ "node", "server.js" ]
@firatkucuk
firatkucuk / rest-endpoint-standards.md
Created July 5, 2019 09:58
REST Endpoint standards for single page applications.

Backend:

GET     /api/some-resource/{uuid}               Get Detail of single resource
POST    /api/some-resource                      Create resource with incoming data
PUT     /api/some-resource/{uuid}               Update resource with incoming data
DELETE  /api/some-resource/{uuid}               Delete resource
GET     /api/some-resources                     List all resources with post data

XXXX    /api/some-resource/{uuid}/some-action   Perform some action for that specified resource
@firatkucuk
firatkucuk / delete-slack-messages.js
Last active November 5, 2024 13:15
Deletes slack public/private channel messages, private chat messages and channel thread replies.
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID
// CONFIGURATION #######################################################################################################
const token = 'SLACK TOKEN';
// Legacy tokens are no more supported.
// Please create an app or use an existing Slack App
@firatkucuk
firatkucuk / decimal-to-hex.java
Created June 12, 2017 18:11
Try to convert arbitrary length string decimal to string hexadecimal
public class Decimal2Hex {
private static String[] HEX = new String[]{
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"
};
public static String convert(final String numberText) {
final Object[] result = divideTo16(numberText);
final String quotient = (String) result[0];
import {AbstractControl} from '@angular/forms';
import {DbService} from '../service/db.service';
import {isArray} from 'util';
declare const $: any;
export class TagInput {
private _inputItem: any;
@firatkucuk
firatkucuk / BasHarflerBuyuk.txt
Created August 2, 2016 19:42
Yalnızca baş harfleri büyük yapmak için OpenOffice formülü
=BİRLEŞTİR(BÜYÜKHARF(PARÇAAL(D1;1;1));PARÇAAL(D1;2;UZUNLUK(D1)-1))
@firatkucuk
firatkucuk / tez.vim
Created August 2, 2016 19:39
Yüksek lisans tezi vim script dosyası
if exists("b:current_syntax")
finish
endif
syntax region tezYapilacak start="\[YAPILACAK:" end="\]"
hi def link tezYapilacak Label
"highlight tezYapilacak ctermbg=magenta
@firatkucuk
firatkucuk / detect_malicious_code.sh
Created May 10, 2016 22:08
Malicious PHP code detection
grep -r "base64_decode" --include=*.php [TARGET]
grep -r "eval" --include=*.php [TARGET]
grep -E -r "[a-zA-Z0-9+]{20,}" --include=*.php [TARGET]
WITH filtered_tag_log AS (
SELECT
data_value,
logtime,
logtime / (60 * 60 * 1000) log_hour
FROM
tag_log
WHERE
tag_id = 1
AND
@firatkucuk
firatkucuk / sinon_spy.js
Created January 4, 2015 20:48
sinon.js spy usage
'use strict';
var sinon = require('sinon');
var assert = require('assert');
var testObject = {
'testMethod': function () {
return 'testtest';
}