Skip to content

Instantly share code, notes, and snippets.

View smhemel's full-sized avatar
😊
Happy

S M HEMEL smhemel

😊
Happy
  • Enosis Solutions
  • Dhaka, Bangladesh.
  • 14:04 (UTC +06:00)
View GitHub Profile
extension UIButton {
func pulsate() {
let pulse = CASpringAnimation(keyPath: "transform.scale")
pulse.duration = 0.6
pulse.fromValue = 0.95
pulse.toValue = 1.0
pulse.autoreverses = true
pulse.repeatCount = 2
//
// CustomUIViewClass.swift
//
// Created by S M HEMEL on 12/09/18.
// Copyright © 2018 S M HEMEL. All rights reserved.
//
import UIKit
@IBDesignable
import UIKit
@IBDesignable
class UIButtonX: UIButton {
enum FromDirection:Int {
case Top = 0
case Right = 1
case Bottom = 2
case Left = 3
// Add your project and customize you UIImageViewer.
import UIKit
@IBDesignable
class UIImageViewX: UIImageView {
// MARK: - Properties
@IBInspectable public var borderColor: UIColor = UIColor.clear {
// This file add your project and customize your Label.
import UIKit
@IBDesignable
class UILabelX: UILabel {
@IBInspectable var cornerRadius: CGFloat = 0 {
didSet {
self.layer.cornerRadius = cornerRadius
@smhemel
smhemel / Sql Query
Created April 10, 2020 21:02
This note is help for manage your database.
//Start MySql in terminal
mysql-ctl cli
//Create Database
CREATE DATABASE test_db;
//List available databases
show databases;
//Delete Or Drop a database
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root', // your root username (leave as root)
database : 'join_us', // the name of your db (create this if you haven't already)
password : process.env.MYSQL_PW // your root user's password
});
//If you want to impor password then

deb software installer

sudo install

NodeJS install

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
@smhemel
smhemel / arrayBufferToString.js
Created April 27, 2023 17:33 — forked from skratchdot/arrayBufferToString.js
Array Buffer -> String and String -> ArrayBuffer conversions in javascript
// source: http://stackoverflow.com/a/11058858
function ab2str(buf) {
return String.fromCharCode.apply(null, new Uint16Array(buf));
}
@smhemel
smhemel / git.md
Last active August 21, 2023 11:16

Git Documentation

Configure Git(Set Username and Email)

  • First, install git into you machine.
  • Set Username - git config --global user.name "Sm Hemel"
  • Set Email - git config --global user.email smhemel.eu@gmail.com

Some common command-line command

  • Show file list with hidden file - ls -a
  • Create file - touch test.txt