Skip to content

Instantly share code, notes, and snippets.

View bollu's full-sized avatar

Siddharth bollu

View GitHub Profile
@bollu
bollu / graded1.hs
Created December 22, 2020 16:46 — forked from emilypi/graded1.hs
Graded semigroups/monoids/groups - two versions
{-# language FlexibleInstances #-}
{-# language DefaultSignatures #-}
{-# language RankNTypes #-}
{-# language MultiParamTypeClasses #-}
{-# language QuantifiedConstraints #-}
module Data.Group.Graded where
import Data.Functor.WithIndex
import Data.Group
import Data.Map (Map)
@bollu
bollu / flows-problems.txt
Created October 27, 2020 15:31 — forked from anurudhp/flows-problems.md
Collection of problems on flows
http://codeforces.com/problemset/problem/628/F
http://codeforces.com/gym/100729 : Problem F
http://codeforces.com/gym/100517 : Problem H
http://codeforces.com/gym/101128 : Problem F
http://codeforces.com/gym/100491 : Problem A
http://codeforces.com/gym/101175 : Problem D (WF)
http://codeforces.com/gym/101221 : Problem I (WF)
http://codeforces.com/gym/100800 : Problem A
http://codeforces.com/gym/101239 : Problem C (WF)
http://codeforces.com/gym/101208 : Problem C (WF)
; Emulating cps call using LLVM Coroutines
; RUN: opt coro-cps.ll -O2 -enable-coroutines -S
define void @f(i32 %arg) {
entry:
%bar.ret.addr = alloca i32
%id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null)
%size = call i32 @llvm.coro.size.i32()
%alloc = call i8* @malloc(i32 %size)
%hdl = call noalias i8* @llvm.coro.begin(token %id, i8* %alloc)
@bollu
bollu / proxy_switch.sh
Created December 13, 2015 10:04 — forked from jameswomack/proxy_switch.sh
Bash/ZSH for changing git/npm/global proxy info based on current Wifi SSID on Mac
alias airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"
CURRENT_WIFI_SSID=$(eval airport -I | grep '^[[:space:]]*SSID' | sed -e 's/^.*SSID: //g')
proxy() {
export addy='http://www-west.sony.com:80'
git config --global http.proxy $addy
git config --global https.proxy $addy
npm config set http-proxy $addy
npm config set https-proxy $addy
#[link(name="python2.7")]
extern {
fn Py_SetProgramName(name: *u8);
fn Py_Initialize();
fn PyRun_SimpleString(command: *u8);
fn Py_Finalize();
}
fn main() {
let args = std::os::args();
mm@cereal:~/dytest$ rustc -C prefer-dynamic --crate-type=dylib fooz.rs
mm@cereal:~/dytest$ cat fooz.rs
#[no_mangle]
pub extern "C" fn foo(x: int) {
println!("Cowabunga, {}", x);
}
mm@cereal:~/dytest$ cat test.py
import ctypes
fooz = ctypes.CDLL("/home/mm/dytest/libfooz-afaf02c9-0.0.so")
@bollu
bollu / gists.rb
Created March 13, 2014 14:26 — forked from trevorturk/gists.rb
# gem install httparty
# ruby gists.rb
require 'httparty'
class Gists
include HTTParty
@username = 'x'
@password = 'x'

Steps to upgrade vim in arch linux for python runtime support

Python support is needed by vim in order to run things like Conque and Slimv. Arch keeps vim slim by only providing Python support in gvim. But you may prefer vim to gvim, so here's what's needed.

More ABS info.

# Install and run abs (sync)

sudo pacman -S abs