Description | Command |
---|---|
Start a new session with session name | screen -S <session_name> |
List running sessions / screens | screen -ls |
Attach to a running session | screen -x |
Attach to a running session with name | screen -r |
#!/usr/bin/env ruby | |
require "webrick" | |
=begin | |
WEBrick is a Ruby library that makes it easy to build an HTTP server with Ruby. | |
It comes with most installations of Ruby by default (it’s part of the standard library), | |
so you can usually create a basic web/HTTP server with only several lines of code. | |
The following code creates a generic WEBrick server on the local machine on port 1234, |
class Foo | |
attr_reader :bar | |
def initialize | |
@bar = 123 | |
ObjectSpace.define_finalizer( self, self.class.finalize(bar) ) | |
end | |
def self.finalize(bar) | |
proc { puts "DESTROY OBJECT #{bar}" } | |
end |
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
Полезные ссылки изучающему анону
- Список рекомендаций с форчана:
- Ещё один список рекомендаций, на этот раз на русском языке:
- Лучший словарь для PC:
- Онлайн-словари:
- японо-русские:
Generally, the Git proxy configuration depends on the Git Server Protocol you use. And there're two common protocols: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080
. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.
When you do git clone ssh://[user@]server/project.git
or git clone [user@]server:project.git
, you're using the SSH protocol. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config
:
ProxyCommand nc -x localhost:1080 %h %p
char (*__kaboom)[sizeof( xxx )] = 1; | |
// xxx can be a variable or a data type | |
// See https://stackoverflow.com/questions/20979565/how-can-i-print-the-result-of-sizeof-at-compile-time-in-c | |
// Exemple of code: | |
// char (*__kaboom)[sizeof( long long )] = 1; | |
// GCC error: | |
// error: invalid conversion from 'int' to 'char (*)[8]' [-fpermissive] | |
// So sizeof(long long) == 8 |
You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.
I use jq
for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is