This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Usage: sudo ./restore_functionality.sh | |
#ps aux | grep sentinel | awk -F " +" '{print $2}' | xargs kill | |
while true; do | |
launchctl kill SIGKILL system/com.crowdstrike.falcond | |
launchctl kill SIGKILL system/com.crowdstrike.userdaemon | |
launchctl kill SIGKILL system/com.sentinelone.sentineld | |
launchctl kill SIGKILL system/com.sentinelone.sentineld-helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const useScrollIntoView = (condition: boolean) => { | |
const ref = React.useRef<HTMLDivElement | null>(null); | |
React.useEffect(() => { | |
if (condition && ref.current) { | |
ref.current.scrollIntoView({ | |
behavior: 'smooth', | |
block: 'center', | |
inline: 'center', | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Show information about IKEA Tradfri devices firmware from the official IKEA servers | |
# script by github.com/hhromic | |
# optional filter | |
declare -r FILTER=$1 | |
# URLs for firmware channels | |
declare -r -A CHANNEL_URLS=( | |
[CURRENT]=http://fw.ota.homesmart.ikea.net/feed/version_info.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { create } from './websocket-ha'; | |
const homeAssistant = create('http://localhost:8123'); | |
homeAssistant.connect(); | |
await homeAssistant.auth("my secret password"); | |
// Make API calls | |
console.log(await homeAssistant.call({type: 'get_config'})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// handy method to create a Higher Order Component out of a | |
// Render Prop Component (like a Context.Consumer). | |
// handles, statics, displayName, refs, and value forwarding | |
function createHOCFromRenderProp({prop, Consumer}) { | |
return Component => { | |
function Wrapper(props, ref) { | |
return ( | |
<Consumer> | |
{value => <Component {...{...props, [prop]: value, ref}} />} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# NOTE: Requires Ruby 2.1 or greater. | |
# This script can be used to parse and dump the information from | |
# the 'html/contact_info.htm' file in a Facebook user data ZIP download. | |
# | |
# It prints all cell phone call + SMS message + MMS records, plus a summary of each. | |
# | |
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare var __DEV__: boolean; | |
declare module 'react-native' { | |
declare type Color = string | number; | |
declare type Transform = | |
{ perspective: number } | | |
{ scale: number } | | |
{ scaleX: number } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
echo "install docker bash completion" | |
curl -L https://raw.githubusercontent.com/docker/docker/v$(docker version --format '{{.Server.Version}}')/contrib/completion/bash/docker -o /etc/bash_completion.d/docker | |
echo "install docker-compose bash completion" | |
curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose | |
echo ".... done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + | |
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + | |
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' + | |
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));'; | |
try { | |
eval(str); | |
} catch(e) { | |
alert('Your browser does not support ES6!') | |
} |
NewerOlder