This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
extension GlobalKeyExtension on GlobalKey { | |
Rect get globalPaintBounds { | |
final renderObject = currentContext?.findRenderObject(); | |
var translation = renderObject?.getTransformTo(null).getTranslation(); | |
if (translation != null && renderObject?.paintBounds != null) { | |
return renderObject!.paintBounds | |
.shift(Offset(translation.x, translation.y)); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# change working directory | |
cd /home/absensi/webdata/ | |
# build | |
go build data.go | |
# change owner | |
chown absensi:nginx data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ciphers | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha512" | |
"crypto/x509" | |
"encoding/pem" | |
"log" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install watchdog | |
watchmedo auto-restart --directory=. ./manage.py -- run_gunicorn --workers=15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import Image | |
def resize_and_crop(img_path, modified_path, size, crop_type='top'): | |
""" | |
Resize and crop an image to fit the specified size. | |
args: | |
img_path: path for the image to resize. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from passlib.hash import bcrypt | |
def verify_password(pass_us, pass_sv): | |
"""Verify Password | |
Sistem verify password disesuaikan dengan versi core PHP, | |
password akan digenerate ulang dengan versi security terkini | |
setelah dicocokkan. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creator: Phil Cook | |
# Modified: Andy Miller | |
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g') | |
brew_array=("5.5","5.6","7.0","7.1","7.2", "7.3") | |
php_array=("php@5.5" "php@5.6" "php@7.0" "php@7.1" "php@7.2" "php@7.3") | |
valet_support_php_version_array=("php@5.5" "php@5.6" "php@7.0" "php@7.1" "php@7.2" "php@7.3") | |
php_installed_array=() | |
php_version="php@$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.annotation.Nullable; | |
import android.util.Base64; | |
import java.nio.ByteBuffer; | |
import java.security.SecureRandom; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String decrypt(@NotNull String input, @NotNull String key){ | |
byte[] bytes = Base64.decodeBase64(input); | |
if(bytes.length < 17) { | |
return null; | |
} | |
byte[] ivBytes = Arrays.copyOfRange(bytes, 0, 16); | |
byte[] contentBytes = Arrays.copyOfRange(bytes, 16, bytes.length); | |