Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Add union_hack.rb to your project, for example at lib folder and ensure you're loading it on your application.rb file: | |
# You'll need to add something like that | |
config.autoload_paths += %W(#{config.root}/lib) | |
Then extend your favourite model with the module and you'll be able to do unions with unique records, sorted by any fields and limited in number of records (see my_timeline_method): | |
class Profile < ActiveRecord::Base | |
extend UnionHack |
#!/usr/bin/env python | |
import ctypes | |
import wave | |
import sys | |
pa = ctypes.cdll.LoadLibrary('libpulse-simple.so.0') | |
PA_STREAM_PLAYBACK = 1 | |
PA_SAMPLE_S16LE = 3 |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
package com.ethanf.in_app_billing_ex; | |
import java.util.ArrayList; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import com.android.vending.billing.IInAppBillingService; | |
import android.os.Bundle; |
Although this GNU/Linux distro is not supported, were are already running GitLab on an openSUSE server, so let's see if we can set up a GitLab CI (Continuous Integration) server on openSUSE, too. These notes are basically a translation of http://doc.gitlab.com/ci/install/installation.html to SuSE. See also other unofficial GitLab installation guides: https://github.com/gitlabhq/gitlab-public-wiki/wiki/Unofficial-Installation-Guides
Installing the prerequisites is already a hassle, but I was able to map most of the Debian package names to SuSE's naming scheme using distromatch. So here we go:
sudo ln -s /usr/bin/vi /usr/local/bin/editor ## give your favourite text editor a standard name
#![feature(slicing_syntax)] | |
use std::collections::RingBuf; | |
fn main() { | |
let xs = &[1i, 2i, 3i, 4i, 5i]; | |
let mut iter = EachCons { iter: xs.iter(), n: 3, buffer: RingBuf::new() }; | |
for x in iter { | |
println!("{}", x); |
This gist illustrates how two processes can exchange information via subprocess.Popen
.
Integrate an externally running user interface, potentially written in another language. For example, a GUI written in PyQt5 and Python 3 running inside of Autodesk Maya (Python 2.7, PySide).
1 server, 2 clients
Install Wireguard on all machines.
There was a reddit post about installing Arch on NTFS3 partition. Since Windows and Linux doesn't have directories with same names under the /
(C:\
), I thought it's possible, and turned out it was actually possible.
If you are not familiar to Linux, for example you've searched on Google "how to dualboot Linux and Windos" or brbrbr... you mustn't try this. This is not practical.