Open python
python
and type
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1g 7 Apr 2014'
// A cute hack demonstrating one (weird?) way of doing optional | |
// parameters in Go. | |
// | |
// Please don't write code like this. It is fun code, though. | |
// | |
// Output: (see it live at golang.org) | |
// | |
// I like cheese. | |
// Do you like cheese too? | |
// I DO! |
DON'T JUST COPY AND PASTE | |
YOUR USB DRIVE MAY NOT BE /dev/sdd AND THIS WILL ERASE IT | |
$ df -h | |
Filesystem Size Used Avail Use% Mounted on | |
/dev/sda7 7.4G 3.9G 3.2G 56% / | |
none 3.9G 720K 3.9G 1% /dev | |
none 3.9G 704K 3.9G 1% /dev/shm | |
none 3.9G 96K 3.9G 1% /var/run | |
none 3.9G 0 3.9G 0% /var/lock |
start = Time.now | |
loop { | |
elapsed = Time.now - start | |
puts "#{(elapsed/60).round}m:#{(elapsed%60).round}s" | |
sleep 1 | |
} |
require "./mess/*" | |
require "kemal" | |
require "json" | |
require "mysql" | |
require "pool/connection" | |
db = ConnectionPool.new(capacity: 25, timeout: 0.01) do | |
DB.open(ENV["DATABASE_URL"]) | |
end |
http{ | |
index index.html; | |
server { | |
listen 80; | |
root /gocode/src/personalwebsiteapp; | |
server_name personal-website.com; |
var http = require('http'), // intentionally using http to connect to https | |
options = { | |
host: 'localhost', | |
port: 4443, | |
path: '/ping', | |
}; | |
function pingLoop() { | |
http.get(options, function (res) { | |
console.assert(false, "server should never accept http over https"); |
require "http" | |
require "uuid" | |
require "uuid/json" | |
class App | |
include HTTP::Handler | |
def call(context) | |
Fiber.yield # Simulate getting data from the DB | |
response_payload.to_json context.response |
This instruction will allow you to get keys from Google Authenticator via terminal. | |
1) Download oathtool | |
brew install oathtool | |
http://www.nongnu.org/oath-toolkit/oathtool.1.html | |
2) Get your 2-Factor authentication secret key. | |
For example, instead of capturing barcode, ask Google 2-factor auth to enter code manually. | |
And google 2-factor auth will provide you your secret key. |
// The player | |
var player = netflix.cadmium.objects.videoPlayer(); | |
// Metadata about current episode -- ID and url to get frame at a specific time | |
var episodeId = netflix.cadmium.metadata.getActiveVideo().episodeId; | |
var imgRoot = netflix.cadmium.metadata.getActiveVideo().progressImageRoot; | |
// Generates URL of preview image for given timestamp | |
function getFrame(timestamp) { | |
var t = Math.floor(timestamp/10000).toString(10); |
Open python
python
and type
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1g 7 Apr 2014'