Skip to content

Instantly share code, notes, and snippets.

View kopiro's full-sized avatar

Flavio Maria De Stefano kopiro

View GitHub Profile
@kopiro
kopiro / sdkinstall.sh
Created November 3, 2016 09:00
Install Titanium GA SDK
#!/bin/bash
# Usage sdkinstall "5.5.0 5.5.1"
rm -rf /tmp/tisdk
mkdir -p /tmp/tisdk
function install_sdk() {
if [ -d ~/Library/Application\ Support/Titanium/mobilesdk/osx/$2 ]; then
echo "Titanium SDK $2 already installed!"
@kopiro
kopiro / three.doc.js
Created March 21, 2017 16:12
ThreeJS DeviceOrientationControls
/**
* @author richt / http://richt.me
* @author WestLangley / http://github.com/WestLangley
*
* W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)
*/
THREE.DeviceOrientationControls = function( object ) {
var scope = this;
@kopiro
kopiro / flipper-upgrade
Last active October 11, 2023 13:44
Automatic Flipper Zero upgrade from UberGuidoZ repository
#!/bin/bash
FLIPPER_APPS_DIR="/tmp/UberGuidoZFlipper"
FLIPPER_SD_DIR="/Volumes/Flipper SD"
if [ ! -d "$FLIPPER_SD_DIR" ]; then
echo "Flipper SD card not found at $FLIPPER_SD_DIR"
exit 1
fi
@kopiro
kopiro / random-ua.sh
Created September 12, 2014 08:59
Random User agent in BASH
# On Mac, install `gsort` with `brew install coreutils`
UA=$(cat ua.txt | gsort -R | head -1)
@kopiro
kopiro / encript-char-string.js
Created June 9, 2011 12:00
Encrypt in ASCII a string in javascript
javascript:
var s = prompt();
var scoded="String.fromCharCode("; for(var i=0;i<s.length; i++) {
scoded+=s.charCodeAt(i);
if (i<s.length-1) scoded+=",";
}
scoded+=");";
alert(scoded);
@kopiro
kopiro / fb-photo-album-download.js
Last active February 2, 2023 06:21
Download all the photos of a Facebook Album / "Photos of you"
/*
Download all the photos of a Facebook Album / "Photos of you"
If you want to download "the photos that you uploaded",
use the simpler "Your Facebook Information" feature on https://www.facebook.com/settings?tab=your_facebook_information
This script is only useful to download the photos you've been tagged into
You can find this page on: https://www.facebook.com/photos
Make sure you scroll 'til the end of the page, and then paste it into the console
@kopiro
kopiro / tv-hyperhdr.sh
Created January 20, 2023 19:07
HyperHDR on/off binary with WebOS 4.x autostart patch
#!/bin/bash
IP="192.168.0.45"
MAC="AA-BB-CC-DD-EE-FF"
get_status() {
/usr/bin/curl -s "http://$IP:8090/json-rpc?request=%7B%22command%22:%22serverinfo%22%7D"
}
call_autostart() {
@kopiro
kopiro / README.md
Created May 6, 2022 18:57 — forked from Informatic/README.md
openlgtv webOS hacking notes

This is just a dump of some interesting undocumented features of webOS (3.8 specifically, on early 2018 4k LG TV) and other development-related tips.

Homebrew app ideas

@kopiro
kopiro / base.gl.cpp
Created December 30, 2012 18:49
OpenGL base C++ project
#include <iostream>
#include <cmath>
#include <GL/glut.h>
#include <GL/glu.h>
#include <GL/gl.h>
void renderScene() // this function is called when you need to redraw the scene
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); // clear the scene
@kopiro
kopiro / Configuration.h
Last active November 9, 2022 13:47
Artillery Hornet with BLTouch Probe - Marlin 2.1.1
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or