Skip to content

Instantly share code, notes, and snippets.

View julienXX's full-sized avatar

Julien Blanchard julienXX

View GitHub Profile
[colors]
h1 = "red"
h2 = "#FF6347"
h3 = "green"
list = "#C71585"
text = "#FF1493"
background = "#FFC0CB"
[characters]
list = "🌼"
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"fmt"
"net/http"
fn visit_url(s: &mut Cursive, url: &str) {
s.pop_layer();
match get_data(&url) {
Ok(new_content) => {
let mut select = SelectView::new()
.h_align(HAlign::Left)
.autojump();
s.add_layer(Dialog::info(url));
//Tried something a bit brutal like to isolate the leak:
...
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
^{
__block BOOL notificationStillPresent;
NSUInteger notificationsCount = [[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications].count;
do {
notificationStillPresent = NO;
NSUInteger currentCount = [[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications].count;
NSLog(@"initial count %lu", (unsigned long)notificationsCount);
pub fn rewrite_path(context: &RewriteContext,
expr_context: bool,
qself: Option<&ast::QSelf>,
path: &ast::Path,
width: usize,
offset: Indent)
-> Option<String> {
let skip_count = qself.map_or(0, |x| x.position);
let mut result = if path.global && qself.is_none() {
@julienXX
julienXX / gist:2672774bb4d46139435c
Created November 16, 2015 12:46
Rust cross-compilation on OSX
rustc: x86_64-apple-darwin/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd
error: linking with `clang` failed: exit code: 1
note: "clang" "-Wl,--as-needed" "-m64" "-L" "/Users/julien/Code/rust/x86_64-apple-darwin/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "x86_64-apple-darwin/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/std-a5fc0d6c.0.o" "-o" "x86_64-apple-darwin/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-a5fc0d6c.so" "x86_64-apple-darwin/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/std-a5fc0d6c.metadata.o" "-Wl,-O1" "-nodefaultlibs" "-Wl,--whole-archive" "/var/folders/ch/w6vlkkr912n00b_t8q6dkgl00000gn/T/rustc.UYg7RveANPbS/libcollections-a5fc0d6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/var/folders/ch/w6vlkkr912n00b_t8q6dkgl00000gn/T/rustc.UYg7RveANPbS/liballoc-a5fc0d6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/var/folders/ch/w6vlkkr912n00b_t8q6dkgl00000gn/T/rustc.UYg7RveANPbS/librustc_unicode-a5fc0d6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archiv

Sush.io is looking for developers

We're a rapidly growing startup and we are seeking to expand our team.

We are a team of 8 people divided into two offices (Paris and SF).

We develop the Sush.io solution for SMBs which are heavy users of Online Services to manage their accounting and invoicing.

We are all focused on delivering value to our customers, in a lean mindset and welcoming ideas from all the team.

@julienXX
julienXX / gist:a2c8ac82d3740a3d2556
Last active September 14, 2015 12:06
Cargo build error
λ cargo build --verbose
Compiling quasi v0.3.2
Running `rustc /Users/julien/.cargo/registry/src/github.com-0a35038f75765ae4/quasi-0.3.2/src/lib.rs --crate-name quasi --crate-type lib -g -C metadata=1fdecb603ecbb4c6 -C extra-filename=-1fdecb603ecbb4c6 --out-dir /Users/julien/Code/soccer/target/debug/deps --emit=dep-info,link -L dependency=/Users/julien/Code/soccer/target/debug/deps -L dependency=/Users/julien/Code/soccer/target/debug/deps -Awarnings`
Compiling aster v0.4.5
Running `rustc /Users/julien/.cargo/registry/src/github.com-0a35038f75765ae4/aster-0.4.5/src/lib.rs --crate-name aster --crate-type lib -g -C metadata=2a46d4b73f937fb9 -C extra-filename=-2a46d4b73f937fb9 --out-dir /Users/julien/Code/soccer/target/debug/deps --emit=dep-info,link -L dependency=/Users/julien/Code/soccer/target/debug/deps -L dependency=/Users/julien/Code/soccer/target/debug/deps -Awarnings`
Fresh pkg-config v0.3.5
Fresh gcc v0.3.13
Fresh winapi-build v0.1.1
Fresh matches v0.1.2
(require 'cl)
(defun is-magit-buffer (buffer)
(let ((name (buffer-name buffer)))
(and (= ?* (aref name 0))
(not (string-match "^\\*magit\\*" name)))))
(defun kill-magit-buffers ()
(interactive)
(loop for buffer being the buffers
import System.Random
import Data.List.Split
randomCells :: Int -> StdGen -> [Int]
randomCells size gen = take size $ randomRs (0, 1) gen
createGeneration :: [Int] -> Int -> [[Int]]
createGeneration cells width = splitEvery width cells
main :: IO() -- declare type signature