Skip to content

Instantly share code, notes, and snippets.

View han4wluc's full-sized avatar

Luciano Hanyon Wu han4wluc

View GitHub Profile
@han4wluc
han4wluc / trial.md
Last active November 1, 2025 11:34
yjh take home

Task 1

  • make puty support testing async function
  • finish rettangoli.dev website & push it

Task 2

  • jempl build a playground
  • similar to:
@han4wluc
han4wluc / change-theme.md
Last active August 23, 2024 14:14
Changing a color theme css variables in html css javascript
<head>
    <link id="theme" rel="stylesheet" href="theme-light.css">
</head>

theme-light.css

@han4wluc
han4wluc / progress.css
Created August 21, 2024 05:24
Prompt to create a progress bar
/*
css for a infinitively loading progress bar. progress bar background; #ccc. active loading color: red.
width: 500px
height: 4px;
I can configure speed of loading, lengh of animation active bar should be changing and dynamic.
*/
@han4wluc
han4wluc / LocationService.java
Created December 18, 2020 11:48
android getLocation problem
public void requestLocationUpdates(Activity activity) {
LocationManager locationManager = (LocationManager) activity.getSystemService(Context.LOCATION_SERVICE);
if (ActivityCompat.checkSelfPermission(activity, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(activity, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
Log.d(TAG, "no location permission");
return;
}
Log.d(TAG, "available location providers: " + Arrays.toString(locationManager.getProviders(true).toArray()));
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!--<item name="colorAccent">#aaaaaa</item>-->
<!--<item name="colorPrimary">#aaaaaa</item>-->
<!--<item name="colorPrimaryDark">#aaaaaa</item>-->
<item name="android:progressBarStyle">@style/progress</item>
<item name="android:indeterminateProgressStyle">@style/progress</item>
<item name="android:switchStyle">@style/swith</item>
<item name="android:textAppearance">@style/text</item>
@han4wluc
han4wluc / start.sh
Last active August 29, 2015 14:24
shell script with sed for ansible
# shell script for the foollwing ansible playbook
# https://gist.github.com/han4wluc/dc2ced0036338cc3cd22
echo "Input your app_name"
read app_name
echo "Input your db_name"
read db_name
echo "Input your repository"
@han4wluc
han4wluc / play.yml
Last active August 29, 2015 14:24
play.yml docker
# shell script to run this playbook:
# https://gist.github.com/han4wluc/dd11d86ad2fabc58c81b
---
- hosts: web
vars:
appname: $app_name
dbname: $db_name
repository: $repository
app_port: $app_port