Skip to content

Instantly share code, notes, and snippets.

View juliancheal's full-sized avatar

Julian Cheal juliancheal

View GitHub Profile
@DieterReuter
DieterReuter / user-data-wifi.yml
Created October 31, 2017 11:08
HypriotOS cloud-init configuration for RPi3 WiFi Client
#cloud-config
# vim: syntax=yaml
#
# The current version of cloud-init in the Hypriot rpi-64 is 0.7.9
# When dealing with cloud-init, it is SUPER important to know the version
# I have wasted many hours creating servers to find out the module I was trying to use wasn't in the cloud-init version I had
# Documentation: http://cloudinit.readthedocs.io/en/0.7.9/index.html
# Set your hostname here, the manage_etc_hosts will update the hosts file entries as well

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
@MoOx
MoOx / README.md
Last active May 11, 2023 13:59
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
@krtschmr
krtschmr / sonoff.rb
Created September 12, 2017 09:57
controll a sonoff-tasmota device via ruby
# Free to use. if you modify it, pls let me know, i might need your code aswell :-)
# github: krtschmr
# [email protected]
# USAGE
# Straightforward
# Sonoff.on!("192.168.1.53")
# Sonoff.off!("192.168.1.53")
@Ambroos
Ambroos / WARNING.md
Last active March 13, 2025 04:04
Remove SentinelOne agent from Mac. Because honestly, it doesn't seem to do anything at all. Run as root, best is to do this from a recovery mode, single user mode with writeable filesystem, ...

USE AT OWN RISK

This was only tested on a 'partial' SentinelOne installation on the High Sierra beta, where SentinelOne was never allowed to enable it's kernel extension. (Some things failed while I was messing around with OS betas.)

This script is most likely outdated.

A lot happens in 2+ years, at this point there's a good chance this script will do more harm than good. Read the comments before using!

@mankind
mankind / rails-jsonb-queries
Last active April 14, 2025 05:43
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@chrisarcand
chrisarcand / dynamic_module_lookup.rb
Last active February 23, 2016 16:58
Dynamic module lookup in Ruby
# What do you suppose the output of the examples are?
# Note: If you want to tinker executing these, don't just copy paste the entire file
# as defining everything in the same file acts differently (expected effects of reopening constants)
############## EXAMPLE 1 ##############
module NameHelper
def full_name
"#{first_name} #{last_name}"
end
end
# Alexandre rANGEL
# "sunday morning worship code" (v13)
# www.quasecinema.org
# 06-Feb-2016
# Sonic Pi 2.12
mybpm = 144
use_bpm mybpm
startClock = 0 # 0 to start song at beginning
clock = 0 # global var
@gomfunkel
gomfunkel / elgato-eve.md
Last active October 29, 2024 19:01
Elgato Eve HomeKit Services & Characteristics

Elgato Eve HomeKit Services & Characteristics

A work in progress collection of proprietary and as of yet undocumented HomeKit characteristics and their UUIDs used by Elgato Eve.

This list is not including all Eve accessories available and some services and characteristics still make no sense to me. If you have anything to contribute, please leave a comment. There is no guarantee that the information listed below is correct.

Elgato Eve Energy (Firmware Revision 1.3.1;466)

Service - Characteristic UUID R W Type Description
@jindrichmynarz
jindrichmynarz / dub_techno_in_sonic_pi.rb
Created December 8, 2015 19:11
Dub techno in Sonic Pi
use_debug false
use_bpm 130
# Our mixer!
master = (ramp *range(0, 1, 0.01))
kick_volume = 1
bass_volume = 1
revbass_volume = 1
snare_volume = 0.5
hats_volume = 0.5