Skip to content

Instantly share code, notes, and snippets.

View erayerdin's full-sized avatar

Eray Erdin (&mut self) erayerdin

View GitHub Profile
@makiftutuncu
makiftutuncu / InterfaceAbstractClass.java
Last active December 21, 2019 22:10
A cliché example of interface vs. abstract class in Java
// Behavior of talking
interface Talks {
void talk(String what);
}
// Behavior of making sound
interface MakesSound {
void makeSound(String what);
}
@clbarnes
clbarnes / install.sh
Last active October 29, 2022 12:21
Git hook installation script
#!/bin/bash
# Adapted from https://gist.github.com/tilap/0590e78c9cfd8f6548f5
# Basic script to set custom project hook and share it with other developers
#
# cd [path-of-the-script]
# . install.sh
#
# Folders usecase
import requests
import requests_mock
def match_limited(request):
return '"Limit":10' in request.text
def match_limitless(request):
return '"Limit":10' not in request.text
limited_response = "limited"
@corerman
corerman / Manjaro_install_MariaDB.sh
Created May 14, 2018 09:41
Manjaro install MariaDB
pacman -S mariadb
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql //注意这个datadir,很重要,按照默认操作
systemctl enable mysqld
systemctl start mysqld
mysql_secure_installation
@demidovakatya
demidovakatya / anime.md
Last active January 17, 2024 09:33
telegram stickers // anime
@IgnoredAmbience
IgnoredAmbience / 99-noto-mono-color-emoji.conf
Last active May 8, 2024 06:50
Noto Emoji Color fontconfig for Konsole
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
Usage:
0. Ensure that the Noto fonts are installed on your machine.
1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf
@vaibhav-jain
vaibhav-jain / UniqueTogetherValidator.py
Created July 2, 2016 12:45
Django Rest Framework (DRF) Custom Unique Together Message
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class SomeSerializer(serializers.ModelSerializer):
"""
Demostrating How to Override DRF UniqueTogetherValidator Message
"""
class Meta:
{
"ab":{
"name":"Abkhaz",
"nativeName":"аҧсуа"
},
"aa":{
"name":"Afar",
"nativeName":"Afaraf"
},
"af":{
@ilopez
ilopez / gson-unirest.java
Created March 25, 2016 15:54
Using Gson with Unirest
Unirest.setObjectMapper(new ObjectMapper() {
private Gson gson = new Gson();
public <T> T readValue(String s, Class<T> aClass) {
try{
return gson.fromJson(s, aClass);
}catch(Exception e){
throw new RuntimeException(e);
}
}
@subfuzion
subfuzion / global-gitignore.md
Last active July 16, 2024 18:54
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.