Skip to content

Instantly share code, notes, and snippets.

View xaph's full-sized avatar

Zafer CAKMAK xaph

  • polarsteps
  • amsterdam
View GitHub Profile
@xaph
xaph / building-sync-systems.md
Created March 4, 2025 15:54 — forked from pesterhazy/building-sync-systems.md
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@xaph
xaph / openssl_commands.md
Created June 8, 2023 18:50 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@xaph
xaph / create_user_and_db.sh
Created June 22, 2020 05:35
postgres create user and db
# Create the JIRA user:
/opt/PostgreSQL/8.4/bin/createuser -S -d -r -P -E jirauser
# Create the JIRA database:
/opt/PostgreSQL/8.4/bin/createdb --owner jirauser --encoding utf8 jira
@xaph
xaph / BootApplication.java
Created February 29, 2016 22:08 — forked from seanhinkley/BootApplication.java
spring boot + thymeleaf 3
package com.boot;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.SpringApplication;
//make sure spring boot doesn't attempt 2.1 config
@SpringBootApplication(exclude={org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration.class} )
public class AppApplication {
public static void main(String[] args) {
SpringApplication.run(AppSecurityApplication.class, args);
}
}
HTTP Status 500 - Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'org.thymeleaf.standard.processor.attr.StandardEachAttrProcessor' (userListWithItems)
type Exception report
message Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'org.thymeleaf.standard.processor.attr.StandardEachAttrProcessor' (userListWithItems)
description The server encountered an internal error that prevented it from fulfilling this request.
exception
@xaph
xaph / gist:35c9bba0a178ad60db1a
Created July 1, 2015 13:52
lost folder hata
tcKimlikNoDogrula.result=true
javax.mail.FolderClosedException: Lost folder connection to server
at com.sun.mail.imap.IMAPFolder.checkOpened(IMAPFolder.java:457)
at com.sun.mail.imap.IMAPFolder.search(IMAPFolder.java:2121)
at com.kodgemisi.mailfetcher.MailFetcherImpl.fetchMails(MailFetcherImpl.java:74)
at com.kodgemisi.webapps.kampci.service.MailServiceImpl.checkIfUserPassQuiz(MailServiceImpl.java:36)
at com.kodgemisi.webapps.kampci.controller.TrelloController.apply(TrelloController.java:53)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
=> #<HTTParty::Response:0x7f33684623f8 parsed_response={"ApiResponse"=>{"Errors"=>{"Error"=>{"__content__"=>"TLD is Invalid.", "Number"=>"2011280"}}, "Warnings"=>nil, "RequestedCommand"=>"namecheap.domains.create", "CommandResponse"=>{"DomainCreateResult"=>{"Domain"=>"", "ChargedAmount"=>"0", "DomainID"=>"0", "OrderID"=>"0", "TransactionID"=>"0", "WhoisguardEnable"=>"false", "FreePositiveSSL"=>"false", "NonRealTimeDomain"=>"false"}, "Type"=>"namecheap.domains.create"}, "Server"=>"PHX01SBAPI01", "GMTTimeDifference"=>"--4:00", "ExecutionTime"=>"0.023", "Status"=>"ERROR"}}, @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"cache-control"=>["private"], "content-type"=>["text/xml; charset=utf-8"], "vary"=>["Accept-Encoding"], "server"=>["Microsoft-IIS/8.5"], "x-aspnet-version"=>["4.0.30319"], "x-powered-by"=>["ASP.NET"], "date"=>["Fri, 10 Apr 2015 08:30:48 GMT"], "connection"=>["close"], "content-length"=>["516"]}>
def create_domain(domain)
#check availability return boolean value
if check_availability(domain)
domain_data = {
"Years"=> 1,
"RegistrantFirstName"=> "Hasan",
"RegistrantLastName"=> "Calik",
"RegistrantAddress1"=> "cankaya",
"RegistrantCity"=> "izmir",
"RegistrantStateProvince"=> "izmir",
@xaph
xaph / country_import.rb
Created August 11, 2013 20:06
importing data from db export
#!/usr/bin/env ruby
# encoding: UTF-8
# RUN this line on mysql before run this script
# select id, name from countries INTO OUTFILE '/tmp/countries.txt';
@f = File.new('/tmp/countries.txt', 'r')
@f.each do |line|
splitted = line.split("\t")
id = splitted[0]
name_tr = splitted[1]
@xaph
xaph / index.md
Created July 7, 2013 09:21 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one