Skip to content

Instantly share code, notes, and snippets.

chaeplin chaeplin

  • Seoul, South Korea
Block or report user

Report or block chaeplin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View variable_test.py
import unittest
class User:
number = 1
articles = []
# def __init__(self):
# self.number = 1
# self.articles = []
@nmarley
nmarley / swap-version.php
Last active Dec 15, 2016
BIP32 serialization version byte swap using BitWasp's bitcoin-php library
View swap-version.php
<?php
use BitWasp\Bitcoin\Base58;
use BitWasp\Buffertools\Buffer;
use BitWasp\Buffertools\BufferInterface;
use BitWasp\Buffertools\Buffertools;
require "./vendor/autoload.php";
class XKeyUtil {
@nmarley
nmarley / conv.rb
Last active Aug 9, 2017
Convert Dash BIP32 extended public key version prefix from 'xpub' to 'drkv'
View conv.rb
#! /usr/bin/env ruby
# Utility converting BIP32 extended key version bytes
require './dashutil'
xkey = ARGV.shift
pref = ARGV.shift
# xpub661MyMwAqRbcFnEEbFf8idiyo8QGKiqhTujUmaJsDhAEZ82cEQPMq69Y4V27vGc5rJnxsd26kyHpBJDW72YMjntsmASbdBy1awfGMsUvLCa
@ajfisher
ajfisher / _Ping I2C Johnny Five backpack.md
Last active Jul 28, 2019
Building an I2C backpack for HC-SR04 ultrasonic sensor
View _Ping I2C Johnny Five backpack.md

Building an ultrasonic sensor backpack

Note: This is a bit of a scratch to see what's involved in getting the ping sensor to work as an I2C backpack.

Acknowledgements

Dependencies.

@igrr
igrr / esp8266_pubsubclient.ino
Created Jan 6, 2015
PubSubClient sample for ESP8266 Arduino
View esp8266_pubsubclient.ino
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
const char* ssid = ".................";
const char* password = "................";
char* topic = "esp8266_arduino_out";
char* server = "iot.eclipse.org";
View haproxy-snmpd.py
#!/usr/bin/env python
"""
SNMP helper for HAproxy implementing EXCELIANCE-MIB with
`pass_persist` protocol. Data are retrieved from multiple instances of
haproxy using HTTP.
"""
def toOid(oid):
"""Convert a string to tuple OID"""
@laurenarcher
laurenarcher / livestreamingyoutube
Created Nov 21, 2014
Livestreaming to Youtube Live, Ubuntu, Linux FFMPEG
View livestreamingyoutube
Terminal Commands:
One webcam:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
Two webcam overlay:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
@sr75
sr75 / osx-homebrew-setup.md
Last active May 23, 2019
Mac Yosemite OSX - Homebrew (RVM/MySQL/Redis) setup
View osx-homebrew-setup.md

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2

@jackiekazil
jackiekazil / rounding_decimals.md
Last active Nov 8, 2019
How do I round to 2 decimals in python?
View rounding_decimals.md

How do I round to 2 decimals?

In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.

All the examples use demical types, except for the original value, which is automatically casted as a float.

To set the context of what we are working with, let's start with an original value.

Original Value

@KartikTalwar
KartikTalwar / Documentation.md
Last active Nov 12, 2019
Rsync over SSH - (40MB/s over 1GB NICs)
View Documentation.md

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
You can’t perform that action at this time.