Skip to content

Instantly share code, notes, and snippets.

View hatamiarash7's full-sized avatar
🤖
*beep boop* overworked !

Arash Hatami hatamiarash7

🤖
*beep boop* overworked !
View GitHub Profile
@hatamiarash7
hatamiarash7 / LEARN-1.md
Created January 6, 2018 22:34
Create dot files/directories (ie .file) on Windows

How to create a .file or .folder on Windows

There are several ways

1. Rename

  • Create file.txt
  • Rename to .file., the last dot will be dropped, you'll have .file

Works the same with a file or a directory.

@hatamiarash7
hatamiarash7 / loggingGUI.py
Created January 12, 2018 22:10 — forked from bitsgalore/loggingGUI.py
Minimal threaded GUI application with logging to both text file and ScrolledText widget
#! /usr/bin/env python
import time
import threading
import logging
try:
import tkinter as tk # Python 3.x
import tkinter.scrolledtext as ScrolledText
except ImportError:
import Tkinter as tk # Python 2.x
import ScrolledText
@hatamiarash7
hatamiarash7 / Activity.java
Last active January 18, 2018 13:33
Android Animated Background
final ImageView backgroundOne = (ImageView) findViewById(R.id.background_one);
final ImageView backgroundTwo = (ImageView) findViewById(R.id.background_two);
final ValueAnimator animator = ValueAnimator.ofFloat(0.0f, 1.0f);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setInterpolator(new LinearInterpolator());
animator.setDuration(10000L);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
@hatamiarash7
hatamiarash7 / .env.travis
Created January 18, 2018 21:40
Laravel Travis CI Config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@hatamiarash7
hatamiarash7 / LEARN-3.md
Created January 19, 2018 16:14
Curl Send Firebase Android Notification

curl -X POST --header "Authorization: key=" --Header "Content-Type: application/json" https://fcm.googleapis.com/fcm/send -d "{\"to\":\"\",\"notification\":{\"body\":\"Yellow\"},\"priority\":10}"

@hatamiarash7
hatamiarash7 / main.py
Created January 20, 2018 14:01
Python - Remove duplicate items in list of model objects
import toolz
class Token(object):
def __init__(self, id, token):
self.id = id
self.token = token
def get_id(self):
return self.id
@hatamiarash7
hatamiarash7 / LEARN-4.md
Created February 22, 2018 23:16
Install Certum Certificate
  • buy
  • make CSR / Private
  • cat SHA-2.crt Certum_Domain_Validation_CA_SHA2.crt Certum_Trusted_Network_CA.crt mine > bundle.crt
  • copy certs to /usr/local/share/ca-certificates
  • sudo update-ca-certificates
  • reboot
  • config nginx / reload
  • check using : openssl s_client -connect domain:443 -CApath /etc/ssl/certs
@hatamiarash7
hatamiarash7 / LEARN-5.md
Last active February 23, 2018 18:06
Install Certum Certificate - Ubutnu
  • CSR / Private / buy
  • cat SHA-2.crt Certum_Domain_Validation_CA_SHA2.crt Certum_Trusted_Network_CA.crt mine > bundle.crt
  • copy certs to /usr/local/share/ca-certificates
  • sudo update-ca-certificates
  • reboot
  • config nginx / reload
  • check using : openssl s_client -connect domain:443 -CApath /etc/ssl/certs
@hatamiarash7
hatamiarash7 / LEARN-6.md
Created February 23, 2018 18:09
Android Toolbar Logo Size
  • MDPI : 75x32
  • HDPI : 112x48
  • XHDPI : 149x64
  • XXHDPI : 225x96
  • XXXHDPI : 300x128
@hatamiarash7
hatamiarash7 / hideStatusbar.java
Created March 19, 2018 21:42
Android - Hide statusbar
public static void hideStatusbar(Activity context) {
if (Build.VERSION.SDK_INT < 16) {
context.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
View decorView = context.getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
}