This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
func fetch(cachePolicy: URLRequest.CachePolicy) { | |
let apiToken = ProcessInfo.processInfo.environment["GITHUB_API_TOKEN"]! | |
var request = URLRequest(url: URL(string: "https://api.github.com/notifications?all=false&participating=true")!, cachePolicy: cachePolicy) | |
request.addValue("token \(apiToken)", forHTTPHeaderField: "Authorization") | |
request.addValue("no-cache", forHTTPHeaderField: "Cache-Control") | |
URLSession.shared.dataTask(with: request) { _, response, _ in | |
guard let httpResponse = response as? HTTPURLResponse else { return } | |
let headers = httpResponse.allHeaderFields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import time | |
import threading | |
import random | |
import numpy as np | |
import pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::BTreeMap; | |
use std::collections::Bound::Included; | |
static mut INC: i32 = 0; | |
fn inc() -> i32 { | |
unsafe { | |
INC += 1; | |
INC | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/yuin/gopher-lua" | |
"fmt" | |
) | |
const debug = false | |
const count = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdbool.h> | |
#include <assert.h> | |
typedef struct { | |
int locked; | |
} mutex_t; | |
static void mutex_init(mutex_t *mtx) { | |
mtx->locked = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <inttypes.h> | |
#include <stdbool.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/time.h> | |
#include <assert.h> | |
#include <getopt.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'weakref' | |
$LEAK = true | |
class Hidden | |
def initialize(cls) | |
@cls = cls | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'weakref' | |
class Proxy < BasicObject | |
attr_reader :cls | |
def initialize(cls) | |
@cls = cls | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'weakref' | |
foo = 'toto' | |
weak = WeakRef.new foo | |
f = Fiber.new do | |
p foo | |
# if fiber yield is not called the fiber context is never released |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'celluloid' | |
require 'weakref' | |
class Bar | |
attr_reader :bar | |
def initialize(bar) | |
@bar = bar |
NewerOlder