Skip to content

Instantly share code, notes, and snippets.

View cristlee's full-sized avatar

Feng Li cristlee

  • Rainbow Joy
  • Beijing, China
View GitHub Profile
@gagarine
gagarine / win11-mouse-scroll-reverse.md
Last active July 4, 2025 08:14
Reverse Mouse Wheel scroll in Windows 11 (Natural Mode like MacOS)

Reverse Mouse Wheel scroll in Windows 11

Chose between natural mode like MacOS or Windows default mode.

Step 1: Open Windows PowerShell in Administrator Mode.

You can do this by going to Start Menu, type PowerShell, and click Run as Administrator.

Step 2: Copy the following code and paste it in the command line of Windows PowerShell:

$mode = Read-host "How do you like your mouse scroll (0 or 1)?"; Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { "$($_.Name): $($_.DeviceID)"; Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name FlipFlopWheel -Value $mode; "+--- Value of FlipFlopWheel is set to " + (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters").FlipFlopWheel + "`n" }
@LeoDroidCoder
LeoDroidCoder / AdMobBannerData.kt
Created September 14, 2020 20:53
A gist for the article on FirebaseRemote config https://medium.com/p/89687a78e367
package com.leodroidcoder.remoteconfigsample
import com.google.gson.annotations.SerializedName
data class AdMobBannerData(
@SerializedName("id") val id: String,
@SerializedName("enabled") val enabled: Boolean
)
@favoyang
favoyang / BuildAddressables.cs
Last active January 29, 2025 08:24
Build addressable bundles when clicking the build button
/// <summary>
/// The script gives you choice to whether to build addressable bundles when clicking the build button.
/// For custom build script, call PreExport method yourself.
/// For cloud build, put BuildAddressablesProcessor.PreExport as PreExport command.
/// Discussion: https://forum.unity.com/threads/how-to-trigger-build-player-content-when-build-unity-project.689602/
///
/// License: The MIT License https://opensource.org/licenses/MIT
/// </summary>
using UnityEditor;
using UnityEditor.AddressableAssets;
@paslandau
paslandau / convert-timestamp-to-different-timezone.sql
Last active June 28, 2019 06:21
Convert timestamp/date/datetime to different timezone in BigQuery
#standardSQL
# Convert date / time to a different timezone in BigQuery; standard-sql; 2018-04-08
# @see http://www.pascallandau.com/bigquery-snippets/convert-timestamp-date-datetime-to-different-timezone/
WITH examples AS (
SELECT TIMESTAMP("2018-04-08T15:50:10+00:00") AS timestamp # Daylight saving time
UNION ALL SELECT TIMESTAMP("2018-03-08T15:50:10+00:00") # Standard time
)
SELECT
timestamp,
DATETIME(timestamp) as datetime,
@bjinwright
bjinwright / cognito.py
Last active January 18, 2022 00:25
Example of how to make an authorized call to API Gateway using Boto3, Requests, and AWS4Auth. http://stackoverflow.com/questions/37336286/how-do-i-call-an-api-gateway-with-cognito-credentials-in-python
import boto3
import datetime
import json
from requests_aws4auth import AWS4Auth
import requests
boto3.setup_default_session(region_name='us-east-1')
identity = boto3.client('cognito-identity', region_name='us-east-1')
account_id='XXXXXXXXXXXXXXX'
@bshuler
bshuler / README.md
Last active September 30, 2023 15:24 — forked from halr9000/README.md
How to make fake data in Splunk using SPL

How to make fake data in Splunk using SPL

Sometimes, you need to fake something in Splunk. Might be during development and you don't feel like writing a real search, but you really need a number for a dashboard panel to look right. Maybe you are helping someone with a hairy regex, and you don't want to index data just to test it on your instance. Whatever the reason, here are some searches that have helped me out.

Note that when using these techniques, you are not going through the indexing

@alexcasalboni
alexcasalboni / 0-README.md
Last active December 11, 2020 22:41
AWS Lambda: Advanced Coding Session - clda.co/aws-lambda-webinar

AWS Lambda: Advanced Coding Session (slides)

Live demos:

  1. Amazon API Gateway Access Control
  2. Amazon Kinesis Streams processing
  3. Amazon Cognito Sync trigger
  4. AWS CloudFormation Custom Resources
@eferro
eferro / _aws_golang_examples.md
Last active August 21, 2024 05:20
golang aws: examples

AWS Golang SDK examples

@alexcasalboni
alexcasalboni / requirements.txt
Last active June 29, 2017 09:46
Let's build a scikit-learn model
sklearn
numpy
scipy
matplotlib
pandas
@stesie
stesie / index.html
Created April 1, 2016 22:28
AWS IoT-based serverless JS-Webapp Pub/Sub demo
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>AWS IoT Pub/Sub Demo</title>
</head>
<body>
<h1>AWS IoT Pub/Sub Demo</h1>
<form>
<button type="button" id="connect">connect!</button>