Skip to content

Instantly share code, notes, and snippets.

View ShawnSWu's full-sized avatar
😎

Shawn Wu ShawnSWu

😎
View GitHub Profile
@ShawnSWu
ShawnSWu / mz_invisible_widget.js
Last active April 19, 2025 19:06 — forked from mzeryck/mz_invisible_widget.js
A Scriptable script that creates "invisible" widget backgrounds based on your iOS wallpaper, I create this for iOS 18 version
// Change to true to see a preview of your widget.
const testMode = true
// Optionally specify the size of your widget preview.
const widgetPreview = "large"
/* -- GREETING AND DATE -- */
// Optionally show a greeting based on the time of day.
const showGreeting = true
@ShawnSWu
ShawnSWu / example.cpp
Created October 24, 2022 17:15
Gist範例
#include <iostream>
using namespace std;
int main() {
srand((unsigned)time(NULL));
int p[4];
p[0]=(rand()%9)+1;
p[1]=(rand()%9)+1;
while(p[1] == p[0]){
p[1]=(rand()%9)+1;
@ShawnSWu
ShawnSWu / RomanInteger.go
Created July 8, 2022 01:35
Roman to Integer
func romanToInt(input string) int {
currentPoint := len(input) - 1
result := 0
for currentPoint > 0 {
right := mapInt(getChar(currentPoint, input))
left := mapInt(getChar(currentPoint-1, input))
if right == left {
if result == 0 {
@ShawnSWu
ShawnSWu / JerseyExample.java
Last active June 27, 2021 18:43
JerseyExmaple
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public class ExampleAPI {
/*
@PATH, @GET, @POST, @PUT, @DELETE 這些就不解釋了,夠直覺了。
*/
@GET
@Path("getExamplePath")
public String getExample(){
...
FROM tomcat:8.5.47-jdk8-openjdk
MAINTAINER [email protected]
EXPOSE 8080
WORKDIR /myapp
COPY application.jar /myapp/application
package com.nutn.mcnmqtt;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.annotation.IntegrationComponentScan;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.core.MessageProducer;
package com.shawn.shawnwu4mac.dronebaseonmapbox
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.support.design.widget.FloatingActionButton
import android.util.Log
import com.mapbox.mapboxsdk.Mapbox
import com.mapbox.mapboxsdk.annotations.*
import com.mapbox.mapboxsdk.geometry.LatLng
import com.mapbox.mapboxsdk.maps.MapView
import java.util.*;
public class Main {
static double minAvg;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("輸入機率 用,相隔。");
String input = sc.nextLine();
String[] inputArray = input.split(",");
import java.util.*;
public class Main {
static double minAvg;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("輸入機率 用,相隔。");
String input = sc.nextLine();
String[] inputArray = input.split(",");
import java.util.*;
public class Main {
static double minAvg;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("type in frequency from the keyboard, use , to split.。");
String input = sc.nextLine();
String[] inputArray = input.split(",");