Skip to content

Instantly share code, notes, and snippets.

View Hoto-Cocoa's full-sized avatar
🚙
Driving

Cocoa Hoto Hoto-Cocoa

🚙
Driving
View GitHub Profile
@protrolium
protrolium / YouTube API — getting video thumbnail
Created February 5, 2014 19:57
YouTube API — getting video thumbnail
Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
@jovimon
jovimon / gist:524e116471f249626fd2ccd141f3fe05
Last active April 26, 2024 17:59
compile realtek network driver for pfsense 2.4.x

How to compile and install latest realtek network driver in pfSense 2.4.x (FreeBSD 11.1)

  1. Download FreeBSD 11.1 VMDK and create a VM with it as HDD.

  2. Get FreeBSD source tree for your exact FreeBSD version and uncompress it to /usr/src:

    fetch -o /tmp ftp://ftp.freebsd.org/pub/`uname -s`/releases/`uname -m`/`uname -r | cut -d'-' -f1,2`/src.txz
    tar -C / -xvf /tmp/src.txz
    
  3. Download latest Realtek network driver (you need to input an email address).

@stecman
stecman / _readme.md
Last active April 25, 2024 00:10
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@dduleone
dduleone / l+kemoi.txt
Created January 30, 2014 20:05
L&K Emoji
Raͩnͤsͣoͭmͪ
A
 aͣ bͣ cͣ dͣ eͣ fͣ gͣ hͣ iͣ jͣ kͣ lͣ mͣ nͣ oͣ pͣ qͣ rͣ sͣ tͣ uͣ vͣ wͣ xͣ yͣ zͣ
E
 aͤ bͤ cͤ dͤ eͤ fͤ gͤ hͤ iͤ jͤ kͤ lͤ mͤ nͤ oͤ pͤ qͤ rͤ sͤ tͤ uͤ vͤ wͤ xͤ yͤ zͤ
I
 aͥ bͥ cͥ dͥ eͥ fͥ gͥ hͥ iͥ jͥ kͥ lͥ mͥ nͥ oͥ pͥ qͥ rͥ sͥ tͥ uͥ vͥ wͥ xͥ yͥ zͥ
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 22, 2024 13:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@felquis
felquis / url-schemes.md
Last active April 15, 2024 06:38
iOS, Android browser apps URL Schemes to handle URL between browsers, and apps..

Assume the user is on a mobile device iOS Safari (Or other browser), but you want a link to open into any other specific mobile browser app like Chrome, Safari, Firefox, Opera, Arc... How do you do that?

Chrome

To open on Chrome

<a href="googlechrome://example.com">try it on Chrome</a>

check out Chrome iOS Docs for more information

@masak
masak / explanation.md
Last active April 11, 2024 02:50
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.