Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
'''
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2
Correct PIN for hash and salt below is 1234.
Get 40-character hash value in ascii hex format from file /data/system/password.key on the phone
Get salt in signed numeric format by doing sqlite3 query SELECT value FROM locksettings WHERE name = 'lockscreen.password_salt' on /data/system/locksettings.db
window.onload = function() {
var $rootElement = angular.element(window.document);
var modules = [
'ng',
'myApp',
function($provide) {
$provide.value('$rootElement', $rootElement)
}
];
@sashless
sashless / Send infrared commands from the Arduino to the iRobot Roomba
Created January 26, 2016 19:04 — forked from probonopd/Send infrared commands from the Arduino to the iRobot Roomba
Send infrared commands from the Arduino to the iRobot Roomba. Use a transistor to drive the IR LED from pin D3 for maximal range.
#include <IRremote.h>
/*
Send infrared commands from the Arduino to the iRobot Roomba
by probono
2013-03-17 Initial release
@sashless
sashless / virtualwall_irremote.pde
Created January 26, 2016 19:05 — forked from mschmitt/virtualwall_irremote.pde
A trivial Arduino sketch to mimic iRobot Virtual Wall for Roomba
/*
A trivial Arduino sketch to mimic iRobot Virtual Wall for Roomba
----------------------------------------------------------------
Based on information found at:
http://sites.google.com/site/irobotcreate2/createanirbeacon
Uses "A Multi-Protocol Infrared Remote Library for the Arduino":
http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
@sashless
sashless / react-some-component.d.ts
Created April 5, 2018 08:53 — forked from vsaarinen/react-some-component.d.ts
How to add TypeScript prop type definitions to an existing React component
import * as React from 'react';
declare class SomeReactComponent extends React.Component<SomeReactComponentProps, any> {}
interface SomeReactComponentProps {
className?: string;
toggle?: boolean;
name: string;
size?: 'lg' | '2x' | '3x' | '4x' | '5x';
}
For example, to override the AppBar (https://material-ui-next.com/api/app-bar/) root class we can do the following:
First method (override Material UI classnames):
1 - Add the property classes in the AppBar component:
<AppBar classes={{root: 'my-root-class'}}
2 - Override the styles with the styled components:
styled(AppBar)`
&.my-root-class {
z-index: 1500;
}
@sashless
sashless / darts_load_checkpoint.py
Created May 8, 2024 20:41 — forked from nilsleh/darts_load_checkpoint.py
Exploring saving and loading checkpoint
import numpy as np
import pandas as pd
from tqdm import tqdm_notebook as tqdm
import matplotlib.pyplot as plt
from darts import TimeSeries, concatenate
from darts.dataprocessing.transformers import Scaler
from darts.models import TFTModel
from darts.metrics import mape