I hereby claim:
- I am v12 on github.
- I am v12 (https://keybase.io/v12) on keybase.
- I have a public key ASBBKtP4B7_ookV-cZULR1_GPlFV075JnZbjKZAV_GJ5mQo
To claim this, I am signing this object:
1033edge.com | |
11mail.com | |
123.com | |
123box.net | |
123india.com | |
123mail.cl | |
123qwe.co.uk | |
126.com | |
150ml.com | |
15meg4free.com |
I hereby claim:
To claim this, I am signing this object:
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
int aprintf(char *str, ...) { | |
int i, j, count = 0; | |
va_list argv; | |
va_start(argv, str); | |
for(i = 0, j = 0; str[i] != '\0'; i++) { | |
if (str[i] == '%') { | |
count++; | |
Serial.write(reinterpret_cast<const uint8_t*>(str+j), i-j); |
I like the quote that the programming is all about managing complexity. Maybe you've heard that the computer world is a giant construction of abstractions. We simply wrap things and produce new tools over and over again. Just think for a minute. The languages which you use have build-in functionalities and they are probably abstracted functions of other low level operations. It's the same with JavaScript. [STOP]Sooner or later you need to use abstractions made by other developers. I.e. you depend on someone's other code. I like the dependency-free modules, but that's kinda difficult to achieve. Even if you create those nice black-box liked components you still have a part which combines everything. That's where the dependency injection placed in. The ability to manage the dependencies effectively is absolutely necessary nowadays. This articles sums up my observations on the problem.
Let's say that we have
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: plexconnect | |
# Required-Start: plexmediaserver networking | |
# Required-Stop: plexmediaserver networking | |
# Default-Start: 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: This is the Plex Connect daemon | |
# Description: This script starts the Plex Connect | |
# Python scripts in a detached screen. |
#!/bin/sh | |
# | |
# http://www.packetmischief.ca/monitoring-bind9/ | |
db="/tmp/named.stats" | |
if [ -z "$1" ]; then | |
exit | |
fi |
######## | |
# Name: yandex-ddns | |
# Author: v12 | |
# URL: https://gist.github.com/v12/8892066 | |
######## | |
### Settings section | |
# There is no way of getting token automatically via script, so you should get it manually: https://pddimp.yandex.ru/get_token.xml?domain_name=example.com |
Context2d.prototype.fillTextWrap = function (text, x, y, maxWidth, lineHeight) { | |
var words = text.split(' '), | |
line = '', | |
yOffset = 0, | |
context = this; | |
words.forEach(function (word, index) { | |
line += word + ' '; | |
if(context.measureText(line).width > maxWidth || index == words.length-1) { | |
context.fillText(line, x, y + yOffset); |
# Generate Private Key | |
$ openssl genrsa -out server.key 2048 | |
# Generate CSR | |
$ openssl req -new -out server.csr -key server.key -config openssl.cnf | |
# => Fill in info | |
# Check CSR | |
$ openssl req -text -noout -in server.csr | |
# Sign Cert | |
$ openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile openssl.cnf |