Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View meriororen's full-sized avatar
🎯
Focusing

Isa Ansharullah meriororen

🎯
Focusing
  • PT Hardtmann Mekatroniske Indonesia
  • Jakarta, Indonesia
View GitHub Profile
@fxthomas
fxthomas / gnome-inhibit
Last active March 16, 2024 12:51
Inhibit gnome screensaver for a given program
#!/bin/bash
# Note: Doesn't work anymore (at least for Gnome 3.34, possibly later; see Python script instead)
# Usage: gnome-inhibit <command-line>
# Example: gnome-inhibit mpv video.mp4
cookie=$(dbus-send \
--session \
--dest=org.freedesktop.ScreenSaver \
--type=method_call \
--print-reply=literal \
@smswz
smswz / GridLayout.swift
Last active July 3, 2023 15:51
A simple custom grid UICollectionViewLayout
// MIT License
//
// Copyright (c) 2016 stable|kernel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@poconbhui
poconbhui / play.py
Last active May 22, 2021 18:07 — forked from a1ien/play.py
#!/usr/bin/env python3
#
# DS4 report stuff
#
import struct
from sys import stdin, argv
import os
from io import FileIO
@tonosaman
tonosaman / Howto-build-openocd.md
Last active April 27, 2023 14:01
Olimex ARM-USB-OCD-H / openocd-0.9.0 / libftd2xx1.1.12 / Raspberry Pi 2 / Ubuntu 15.04

for RPi2 JTAG debugging with Olimex ARM-USB-OCD-H

System constitution

  • probe device: Olimex ARM-USB-OCD-H
  • target device: Raspberry Pi 2
    • files for booting: bootcode.bin, start.elf, config.txt from here
    • jtag target image armjtag.bin: from here
    • config.txt: edit to add a line kernel=armjtag.bin
  • host machine: Ubuntu 15.04
    • openocd-0.9.0 as debugger host:
      • probe device driver: libftd2xx1.1.12
@preshing
preshing / build_cross_gcc
Last active April 11, 2024 02:14
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@rvagg
rvagg / README.md
Last active April 21, 2024 08:33
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.
@ruevaughn
ruevaughn / application.log
Created April 3, 2012 18:22
The application.log file of my rails app
Started POST "/tickets/1/comments" for 127.0.0.1 at 2012-04-03 12:16:25 -0600
Processing by CommentsController#create as HTML
Parameters: {"utf8"=>"✓", "comment"=>{"text"=>"Is it out yet?"}, "tags"=>"", "commit"=>"Create Comment", "ticket_id"=>"1"}
State Load (0.0ms) SELECT "states".* FROM "states" 
User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", "1"]]
Project Load (0.0ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 1 LIMIT 1
Permission Load (0.0ms) SELECT "permissions".* FROM "permissions" WHERE "permissions"."user_id" = 2
 (0.0ms) SAVEPOINT active_record_1
Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = 1 LIMIT 1
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@endolith
endolith / Perfect_FFT.py
Last active June 16, 2023 08:25
Perfect FFT
from numpy import linspace, cos, pi, absolute
from numpy.fft import fft, fftfreq, fftshift
import matplotlib.pyplot as plt
# Sampling rate
fs = 64 # Hz
# Time is from 0 to 1 seconds, but leave off the endpoint, so
# that 1.0 seconds is the first sample of the *next* chunk
length = 1 # second
@oz
oz / btscan.rb
Created October 20, 2009 10:07
# Simple bluetooth scan with IOBluetooth (macruby)
framework 'appkit'
framework 'IOBluetooth'
# IOBluetoothInquiryDelegate
class EventHandler
def deviceInquiryStarted(sender)
puts "Searching for devices..."
end