Skip to content

Instantly share code, notes, and snippets.

View piruin's full-sized avatar
🎯
Focusing

Piruin Panichphol piruin

🎯
Focusing
View GitHub Profile
@nrollr
nrollr / nginx.conf
Last active April 22, 2024 15:11
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@nbarraille
nbarraille / OrientationChangeAction.java
Last active January 30, 2023 00:04
An Espresso ViewAction that changes the orientation of the screen
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 - Nathan Barraille
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@bealdav
bealdav / csv2xml4odoo.py
Last active April 18, 2024 05:46
Odoo csv / xml converter
# -*- coding: utf-8 -*-
# based on this code
# http://code.activestate.com/recipes/577423-convert-csv-to-xml/
# convert Odoo csv files in xml files
# csv is easy to maintain but xml data have noupdate feature
# Limitations:
# - relation field One2many is NOT supported
# - csv should have 'id' as first column
@dmytrodanylyk
dmytrodanylyk / res_color_btn_flat_selector.xml
Last active March 4, 2023 07:52
Material Flat Button Style
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:color="@color/flat_disabled_text"/>
<item android:color="@color/flat_normal_text"/>
</selector>
@broady
broady / 1MarkerAnimation.java
Last active March 13, 2024 12:44
Animating Markers
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;
@anthonydahanne
anthonydahanne / PhotoStation_remote_api.md
Last active July 20, 2019 02:21
*unofficial* Documentation of the Synology PhotoStation remote api

Logging in :

POST /photo/mApp/ajax/login.php HTTP/1.1
Content-Length: 113
Content-Type: application/x-www-form-urlencoded
Host: 192.168.1.2:80
Connection: Keep-Alive

action=login&amp;username=user&amp;passwd=password&amp;video_formats=%5B%5B%22*%22%2C0%2C0%2C1280%2C720%2C0%2C%5B%5D%5D%5D
@skhatri
skhatri / quality.gradle
Created February 24, 2012 00:45
Gradle Checkstyle HTML Reporting
apply plugin: 'checkstyle'
checkstyleMain {
ignoreFailures = false
reports {
include ( '**/*.java')
xml {
destination "${rootProject.buildDir}/reports/checkstyle/main.xml"
}
}