Skip to content

Instantly share code, notes, and snippets.

@jason-woolf
jason-woolf / DesmosPlayer.user.js
Last active January 28, 2022 04:51
Programmatically control a Desmos graph
// ==UserScript==
// @name desmosPlayer
// @namespace http://github.com/jason-woolf
// @version 1.0.0
// @description Program a series of graph changes to create animation
// @author Jason Woolf (MathyJaphy)
// @match https://www.desmos.com/calculator*
// @grant none
// @run-at document-idle
// ==/UserScript==
@fearblackcat
fearblackcat / proxy_for_terminal.md
Last active April 13, 2024 18:53
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@devjin0617
devjin0617 / .manifest
Created May 19, 2017 15:15
chrome extension using a content script to access the `window` object
{
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["inject.js"],
"all_frames": true
}
],
"web_accessible_resources": [
"content.js"
@joepie91
joepie91 / random.md
Last active June 2, 2024 19:56
Secure random values (in Node.js)

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's

@jonashackt
jonashackt / bash
Last active December 1, 2021 01:45
Remote debugging Spring Boot
### java -jar
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8001,suspend=y -jar target/cxf-boot-simple-0.0.1-SNAPSHOT.jar
### Maven
Debug Spring Boot app with Maven:
mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8001"
@unitycoder
unitycoder / LatLong.cs
Last active April 17, 2024 16:06
Latitude Longitude Position on 3D Sphere
// blog post: https://unitycoder.com/blog/2016/03/01/latitude-longitude-position-on-3d-sphere-v2/
using UnityEngine;
public class LatLong : MonoBehaviour
{
public Transform marker; // marker object
public float radius = 5; // globe ball radius (unity units)
public float latitude = 51.5072f; // lat
@lopspower
lopspower / README.md
Last active January 20, 2024 09:18
Publish AAR to jCenter and Maven Central

Publish AAR to jCenter and Maven Central

Twitter

EDIT: You can find this same updated tutorial here -> Medium

Now I'm going to list how to publish an Android libray to jCenter and then syncronize it with Maven Central:

  1. I use "Android Studio" and I have this simple android lib that I would like to be available on maven: CircularImageView
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@fadookie
fadookie / runAndroid.sh
Last active September 21, 2022 08:56
Script to install, run, and open logcat for a Unity Android App
#!/bin/sh
# Script to install, run, and open logcat for a Unity Android App.
# I needed this as one of my libraries has a critical post-build script so I can't use "Build and Run" anymore - this is the "and Run" part.
# Be sure to update these variables to match your app's publishing/build settings:
APK_PATH='builds/android/basecode.apk'
BUNDLE_ID='com.eliotlash.basecode'
alias unilogcat='adb logcat|egrep "Unity"'
adb install -r "${APK_PATH}" && adb logcat -c && adb shell am start -n "${BUNDLE_ID}/com.unity3d.player.UnityPlayerNativeActivity" && echo 'DONE, LOG:' && unilogcat
@drmikecrowe
drmikecrowe / reindex-db.js
Last active July 25, 2016 07:22
Complex indices (and post-create index) of Waterline models
/**
* FILE: api/hooks/reindex-db.js
*
* Created by mcrowe on 1/28/15.
*
* Insures indices recreated if needed, and allows complex indicies to be specified in the model as well. Example:
*
module.exports = {
schema : true,
version : "1.3",