Skip to content

Instantly share code, notes, and snippets.

View thibmaek's full-sized avatar
🐹
Currently coding a lot in Go

Thibault Maekelbergh thibmaek

🐹
Currently coding a lot in Go
View GitHub Profile
@lcarsos
lcarsos / restore_functionality.sh
Last active March 28, 2024 17:32
Repeatedly kill sentinelone so you can actually use the processor and ram on your mac
#!/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
@kevinmeyvaert
kevinmeyvaert / useScrollIntoView.tsx
Created January 15, 2019 11:33
Scroll node to center React Hook
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',
});
}
@hhromic
hhromic / tradfri.sh
Last active April 16, 2023 21:06
Show information about IKEA Tradfri devices firmware from the official IKEA servers in Linux
#!/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
@anaisbetts
anaisbetts / example.ts
Created August 26, 2018 20:44
RxJS + Home Assistant
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'}));
// 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}} />}
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /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
@lelandrichardson
lelandrichardson / react-native.js
Last active July 21, 2022 17:56
React Native flow types
declare var __DEV__: boolean;
declare module 'react-native' {
declare type Color = string | number;
declare type Transform =
{ perspective: number } |
{ scale: number } |
{ scaleX: number } |
@gholms
gholms / buttond.py
Last active October 3, 2021 02:02
Unifi wireless voucher generator and requestor button
#!/usr/bin/python3
# Copyright 2017 William Klope
#
# 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 (at your
# option) any later version accepted by the Santa Barbara Hackerspace (or
# its successor approved by the Santa Barbara Hackerspace), which shall
# act as a proxy as defined in Section 14 of version 3 of the license.
@toschneck
toschneck / install_docker_bash_completions.sh
Last active April 2, 2024 12:41
Install Docker and Docker-Compose bash completion
#!/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!"
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!')
}