Skip to content

Instantly share code, notes, and snippets.

View theosp's full-sized avatar

Daniel C theosp

View GitHub Profile
#!/usr/bin/env ruby
# Original: http://tammersaleh.com/posts/the-modern-vim-config-with-pathogen
git_bundles = [
"git://github.com/vim-bundles/fuzzyfinder.git",
"git://github.com/scrooloose/nerdcommenter.git",
"git://github.com/msanders/snipmate.vim.git",
"git://github.com/tpope/vim-cucumber.git",
"git://github.com/tpope/vim-haml.git",
#!/bin/bash
# When under a git repository this script adds the bash prompt indicators about
# the repository status.
#
# the status includes the current branch and colored circles that have the
# following meaning:
# Green: there are staged changes,
# Yellow: if there are unstaged changes
# Red: if there are new untracked-yet-unignored files
#!/usr/bin/env ruby
git_bundles = [
"git://github.com/vim-bundles/fuzzyfinder.git",
"git://github.com/scrooloose/nerdcommenter.git",
"git://github.com/msanders/snipmate.vim.git",
"git://github.com/tpope/vim-cucumber.git",
"git://github.com/tpope/vim-haml.git",
"git://github.com/tpope/vim-rails.git",
"git://github.com/tpope/vim-surround.git"
@theosp
theosp / appengine-imports-from-django
Created April 3, 2011 07:31
appengine 1.4.3 imports from django
./serializer/json.py:22:from django.utils import datetime_safe
./serializer/json.py:23:from django.utils import simplejson
./serializer/python.py:27:from django.conf import settings
./serializer/python.py:28:from django.core.serializers import base
./serializer/python.py:29:from django.core.serializers import python
./serializer/python.py:30:from django.db import models
./serializer/python.py:35:from django.utils.encoding import smart_unicode
./serializer/xml.py:26:from django.conf import settings
./serializer/xml.py:27:from django.core.serializers import base
./serializer/xml.py:28:from django.core.serializers import xml_serializer
@theosp
theosp / test.html
Created April 4, 2011 07:34
head.js dev test
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Using HeadJS</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="http://dock-dev.razoss.com/javascript/base.js"></script>
<script type="text/javascript">
head.js('http://images.apple.com/global/scripts/lib/prototype.js',
@theosp
theosp / pension.js
Last active May 12, 2021 17:27
Pension Calculator
var _ = require("underscore");
var percent = function (i) {
return i / 100;
}
var pensionSumCalculator = function (params) {
var default_params = {
current_savings_in_pensions_funds: 0,
@theosp
theosp / permutations.js
Created August 16, 2013 10:03
A play with permutations
var _ = require("underscore");
var array_size = 4;
var iterations = 200000000;
var get_array = function () {
var a = [];
for (var i = 0; i < array_size; i++) {
a.push(i);
<?php
function sendMessageViaApplePush($apns_environment, $certificate, $pushToken, $messageText) {
if ($apns_environment == "development") {
$serverURL = 'gateway.sandbox.push.apple.com:2195';
} else {
$serverURL = 'gateway.push.apple.com:2195';
}
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', $certificate);
@theosp
theosp / redis.screenrc
Created August 19, 2013 09:18
Launch redis-server and redis-commander in a splitted gnu screen
# launch with: $ screen -c redis.screenrc
screen -t server 0 bash -c 'echo "Launching redis server"; redis-server; bash'
split
focus
screen -t redis-commander 1 bash -c 'redis-commander; bash'
var tls = require('tls');
var fs = require('fs');
var options = {
key: fs.readFileSync('test-key.pem'),
cert: fs.readFileSync('test-cert.pem'),
// This is necessary only if using the client certificate authentication.
requestCert: true,