Skip to content

Instantly share code, notes, and snippets.

View valzav's full-sized avatar

Val valzav

  • US
View GitHub Profile
//Place your logic in some js function, e.g. check_current_user:
<script>
function check_current_user() {
BTSW.current_user(function(user){
// replace the line below with your logic, e.g. if user then show or hide something
console.log("---- check_current_user : ", user);
})
}
</script>
#!/usr/bin/python
import sys
import re
import pygeoip
# Note. Download GeoLite database from http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz and extract to /tmp dir
geoip_rawdata = pygeoip.GeoIP('/tmp/GeoLiteCity.dat')
def ipquery(ip):
data = geoip_rawdata.record_by_name(ip)
@valzav
valzav / gist:11202024
Created April 23, 2014 03:34
This Ruby script extracts dependency data from CMake project (supports nested CMake files) in graphviz's dot format
#!/usr/bin/env ruby
# usage:
# ruby depscanner.rb [path_to_project_dir]
# brew install graphviz / apt-get install graphviz (if graphviz is not installed yet)
# dot -Tpng dependencies.dot -o dependencies.png
$binaries = {}
$dependencies = {}