Skip to content

Instantly share code, notes, and snippets.

Avatar
🧑‍💼
Buried in Codes

Tim Zhang ttimasdf

🧑‍💼
Buried in Codes
View GitHub Profile
@nirvanatikku
nirvanatikku / css_inline_transformer.js
Created Dec 2, 2016
JavaScript CSS Inline Style Transformer (convert CSS + HTML into HTML with inline styles)
View css_inline_transformer.js
/**
* CSS Inline Transform v0.1
* http://tikku.com/css-inline-transformer-simplified
*
* Copyright 2010-2012, Nirvana Tikku
* Dual licensed under the MIT or GPL Version 2 licenses.
* https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
*
* This tool leverages the jQuery library.
*
@martinlindhe
martinlindhe / gdb.rb
Created Jun 29, 2016 — forked from Congee/gdb.rb
For gdb to execute python3 script on OSX 10.10 or later
View gdb.rb
class UniversalBrewedPython < Requirement
satisfy { archs_for_command("python").universal? }
def message; <<-EOS.undent
A build of GDB using a brewed Python was requested, but Python is not
a universal build.
GDB requires Python to be built as a universal binary or it will fail
if attempting to debug a 32-bit binary on a 64-bit host.
EOS
View Crosstool NG 1.22, Raspberry PI
$ git clone -b 1.22 https://github.com/crosstool-ng/crosstool-ng.git
$ cd crosstool-ng
$ ./bootstrap
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd ..
$ mkdir ctng
$ cd rpi1
$ ct-ng menuconfig
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active Mar 3, 2021
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward
View README-setup-tunnel-as-systemd-service.md

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@gbaman
gbaman / HowToOTG.md
Last active Mar 2, 2021
Simple guide for setting up OTG modes on the Raspberry Pi Zero
View HowToOTG.md

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@zeroseis
zeroseis / disable-auto-android-file-transfer.md
Created Sep 14, 2015
Disable auto start for Android File Transfer
View disable-auto-android-file-transfer.md
  • Close Android File Transfer
  • Open Activity Monitor and kill “Android File Transfer Agent”
  • Go to where you installed “Android File Transfer.app” (I have it under /Applications)
  • Ctrl+click –> “Show package contents”
  • Go to Contents/Resources
  • Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
  • Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.
@meeech
meeech / gist:b2dafdb31f90160e833c
Created Jun 29, 2015
pick from whitelist of random themes for oh-my-zsh
View gist:b2dafdb31f90160e833c
#Add to your .zshrc right by ZSH_THEME
#######
# Setup a random theme to load from a list I define
MYZSH_RANDOM_THEMES=(\
're5et' \
'sorin' \
'steeef' \
'dstufft' \
'random' \
View awesome-twitter-bots.md
@kzu
kzu / ObservableDictionary.cs
Last active Jan 6, 2021
An ObservableDictionary<TKey, TValue>
View ObservableDictionary.cs
// Licensed by Daniel Cazzulino under the MIT License
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Dynamic;
using System.Linq;
using System.Text;
@eculver
eculver / protocol-fix.txt
Created Mar 16, 2015
How to deal with tmux "protocol version mismatch"
View protocol-fix.txt
$ tmux attach
protocol version mismatch (client 7, server 6)
$ pgrep tmux
3429
$ /proc/3429/exe attach