Skip to content

Instantly share code, notes, and snippets.

for v in range(height):
for u in range(width):
# Get end of ray and round to sdf array coordinate...
pos = start[v,u,:] + travel[v,u] * norm[v,u,:]
pos += 0.5 * numpy.array(sdf.shape) # Center of sdf to 3D origin
sdf_coordinate = (pos+0.5).astype(int)
# Loop the 3 dimensions and check each is not out of bounds...
for d in range(3):
if sdf_coordinate[d]<0:
@waseem
waseem / query.graphql
Last active July 22, 2022 17:56
Github GraphQL repo commit history for commits made before a certain commit.
query {
repository(owner: "rails", name:"rails") {
ref(qualifiedName:"master") {
target {
... on Commit {
id
#
# We're are requesting commits in the multiple of 5. We can assume that the page size here is 5.
# Next page/cursor should use value in next multiples of 5s. So next page will have a
# after: "05eaa07627376626902bd7acde35406edf1bb2f2 5"
@waseem
waseem / mailgun.rb
Last active October 19, 2018 10:54
Mailgun Webhook POST Request
{
"Message-Id"=>"<20130503182626.18666.16540@barcelonites.com>",
"X-Mailgun-Sid"=>"WyIwNzI5MCIsICJhbGljZUBleGFtcGxlLmNvbSIsICI2Il0=",
"attachment-count"=>"1",
"body-plain"=>"",
"code"=>"550",
"domain"=>"barcelonites.com",
"error"=>"5.1.1 The email account that you tried to reach does not exist. Please try\n5.1.1 double-checking the recipient's email address for typos or\n5.1.1 unnecessary spaces. Learn more at\n5.1.1 http://support.example.com/mail/bin/answer.py",
"event"=>"bounced",
"message-headers"=>"[[\"Received\", \"by luna.mailgun.net with SMTP mgrt 8734663311733; Fri, 03 May 2013 18:26:27 +0000\"], [\"Content-Type\", [\"multipart/alternative\", {\"boundary\": \"eb663d73ae0a4d6c9153cc0aec8b7520\"}]], [\"Mime-Version\", \"1.0\"], [\"Subject\", \"Test bounces webhook\"], [\"From\", \"Bob <bob@barcelonites.com>\"], [\"To\", \"Alice <alice@example.com>\"], [\"Message-Id\", \"<20130503182626.18666.16540@barcelonites.com>\"], [\"List-Unsubscribe\", \"<mailto:u+na6tmy3ege4tgnldmyytqojqmfsdemb
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 8c04cb5..132d803 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -104,6 +104,9 @@
have_func("SSLv2_method")
have_func("SSLv2_server_method")
have_func("SSLv2_client_method")
+have_func("SSLv3_method")
+have_func("SSLv3_server_method")
$ sudo glusterd --debug
[2015-10-31 01:07:01.370073] I [glusterfsd.c:1493:main] 0-glusterd: Started running glusterd version 3.2.6
[2015-10-31 01:07:01.370209] D [glusterfsd.c:374:get_volfp] 0-glusterfsd: loading volume file /etc/glusterfs/glusterd.vol
[2015-10-31 01:07:01.370944] D [xlator.c:1302:xlator_dynload] 0-xlator: dlsym(reconfigure) on /usr/lib/glusterfs/3.2.6/xlator/mgmt/glusterd.so: undefined symbol: reconfigure -- neglecting
[2015-10-31 01:07:01.370975] D [xlator.c:1308:xlator_dynload] 0-xlator: dlsym(validate_options) on /usr/lib/glusterfs/3.2.6/xlator/mgmt/glusterd.so: undefined symbol: validate_options -- neglecting
[2015-10-31 01:07:01.371130] I [glusterd.c:550:init] 0-management: Using /etc/glusterd as working directory
[2015-10-31 01:07:01.371304] D [glusterd.c:242:glusterd_rpcsvc_options_build] 0-: listen-backlog value: 128
[2015-10-31 01:07:01.371985] D [rpcsvc.c:1771:rpcsvc_init] 0-rpc-service: RPC service inited.
[2015-10-31 01:07:01.372010] D [rpcsvc.c:1568:rpcsvc_program_register] 0-rp
The journey has a humble beginning at ISBT Kashmeri Gate with one egg roll in our hands and a few water bottles. It gets interesting and scary after a few kilometers off of Rishikesh when our jeep driver is found smoking marijuana. He tells us his sad life story in a very funny way and casually mentions that it is the most dangerous road he has ever driven a vehicle on. And he had driven across several parts of the country. He shows us Tota Ghati(Parrot Valley) where "Acchey achchon ke totey udd jatey hain gadi chalatey waqt". I look in the abyss and notice that there is only a gap of half foot between the wheels of the jeep and a certain death hundreds of meters down below in Alaknanda river. "Agar yahan gire to seedhey Haridwar mein milengey", a friend quips.
On our way we find an Australian who is making a documentary on mining around the Ganges basin. "The driver is stoned", she says. A couple of minutes later we dodge a truck during a blind turn. We ask our driver to calm down. He does not listen. He sh
@waseem
waseem / asound.conf
Created May 3, 2015 21:20
Archlinux sound does not play.
# Default asound.conf on my machine
$ cat /etc/asound.conf
# Use PulseAudio by default
pcm.!default {
type pulse
fallback "sysdefault"
hint {
show on
description "Default ALSA Output (currently PulseAudio Sound Server)"
"mandrill_events": [
{
"event": "send",
"msg": {
"ts": 1365109999,
"subject": "This an example webhook message",
"email": "example.webhook@mandrillapp.com",
"sender": "example.sender@mandrillapp.com",
"tags": [
"webhook-example"
@waseem
waseem / companies.json
Last active August 29, 2015 14:17
Querying nodes in firebase that have a named key under them.
"application": {
"companies": {
"firebase": {
"creation": {
"name": "Firebase Inc",
"location": "USA"
},
"google": {
"creattion": {
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/waseem/.rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150218-95310-1s53q15.rb extconf.rb
checking for bsBounceStudio_init() in -lBounceStudio... no
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="