View gist:6a34640e66fe6c1b0823f43d034e0f0a
module B
def print
puts C::A
end
end
class C
A = 10
include B
end
View here_hold_my_coffee.rb
class C
class << self
define_method(:a) do |msg|
"hello #{msg}"
end
end
end
puts C.a("world")
View main.go
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strconv"
View at_and_instance_variable.rb
#colleague asks
class A
attr_accessor :b,:d
def a
self.b = 10
@d = 20
end
View split_wav.py
#!/usr/bin/env python
from scipy.io import wavfile
import os
import numpy as np
import argparse
from tqdm import tqdm
# Utility functions
View foo.html
<html>
<head>
<script type="text/javascript" src="http://cdn.clappr.io/latest/clappr.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/clappr.rtmp/0.0.2/rtmp.min.js"></script>
</head>
<body>
<div id="player"></div>
<script>
window.onload = function() {
var player = new Clappr.Player({
View index.html
<!DOCTYPE html>
<html>
<head>
<script>
var map = {};
var toggle = true;
keyEvent = function(e) {
map[e.keyCode] = e.type == 'keydown';
if(map[17] && map[65]) {
img = document.getElementById("image");
View summary_tool.py
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
View gist:9b6705eecd1fcb20b97506a6ddb7bb6e
Publisher:
# Persist message in a queue
lpush channel1.queue message
# Publish message to any connected subscriber
publish channel1 message
Subscriber:
# Subscribe to channel1
subscribe channel1
View gist:54becc25abe46ba98c4c7062e81e2845
package main
import (
"encoding/json"
"fmt"
)
func main() {
mapD := map[string]interface{}{"deploy_status": "public", "status": "live", "version": 2}
mapB, _ := json.Marshal(mapD)