Skip to content

Instantly share code, notes, and snippets.

View svaksha's full-sized avatar
💭
zzZen()

svaksha ॥ स्वक्ष ॥ svaksha

💭
zzZen()
View GitHub Profile
@svaksha
svaksha / Encbox.md
Created July 21, 2013 02:17 — forked from Tho85/Encbox.md

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@svaksha
svaksha / readme.md
Created September 15, 2013 04:39 — forked from coderanger/pycon.md

1: Application Deployment State of the Onion

An overview of the moving pieces in app deployment currently (ex. chef, puppet, salt, ansible, git, omnibus, compass, less, DB migrations, databases).

Description

Deploying a moderately complex web application has become quite a challenge over the years. As best-practices have evolved, it has become progressively more time-consuming to keep up with what tools exist and how to use them effectively. This talk will provide an overview of the ecosystem and provide pointers for more information about individual components or problems.

Audience

Julia Debugging Procedures

So you managed to break Julia. Congratulations! Collected here are some general procedures you can undergo for common symptoms encountered when something goes awry. Including the information from these debugging steps can greatly help the maintainers when tracking down a segfault or trying to figure out why your script is running slower than expected.

If you've been directed to this page, find the symptom that best matches what you're experiencing and follow the instructions to generate the debugging information requested. Table of symptoms:

@svaksha
svaksha / hack_to_paste_images_to_IPYNB.js
Created February 22, 2014 07:05
hack_to_paste_images_to_IPYNB.js
http://mail.scipy.org/pipermail/ipython-dev/2014-February/013156.html
Juergen Hasch's 15 lines of Javascript code to implement "paste images directly from the clipboard (e.g. screenshots) into the notebook" for Chrome. Slow as hell for anything larger than some 10k.
window.addEventListener('paste', function(event){
var cell = IPython.notebook.get_selected_cell();
var items = event.clipboardData.items;
for (var i = 0; i < items.length; ++i) {
if (items[i].kind == 'file' && items[i].type.indexOf('image/') !== -1) {
var blob = items[i].getAsFile();

Julia Debugging Procedures

So you managed to break Julia. Congratulations! Collected here are some general procedures you can undergo for common symptoms encountered when something goes awry. Including the information from these debugging steps can greatly help the maintainers when tracking down a segfault or trying to figure out why your script is running slower than expected.

If you've been directed to this page, find the symptom that best matches what you're experiencing and follow the instructions to generate the debugging information requested. Table of symptoms:

#Python/pypy
import math
def smallestdivisall(n):
for i in xrange(1, math.factorial(n)+1):
for j in xrange(1, n+1):
if i % j != 0:
break
elif j == n:
return i
/* Experimental typographically tinkered IJulia stylesheet
* Copyright © 2013 Jiahao Chen <jiahao@mit.edu>
* MIT License
*
* To use, place in ~/.ipython/profile_julia/static/custom/custom.css
* and refresh IJulia
*
* Based on suggestions from practicaltypography.com
*/
#Working version
using JSON
auth_token= #fill in to access Github API
function getcontribs(owner, repo, auth_token)
#Download information about contributors
page, authors=0, {}
while true #Download every page
page += 1
url="https://api.github.com/repos/$owner/$repo/contributors?page=$(page)&access_token=$(auth_token)"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
.ipynb_checkpoints