Skip to content

Instantly share code, notes, and snippets.

@antics
antics / a
Created August 21, 2021 13:31
acme launcher
#!/bin/sh
export BROWSER=firefox
export tabstop=4
export TERM=dumb
export PAGER=nobs
# Path to 'a' script itself
acme_bin_dir=$( cd $(dirname $0) && pwd )
@antics
antics / gist:4079584
Created November 15, 2012 16:34
Login to Wordpress with curl
curl -D cookie1.txt blog.xrmplatform.org/wp-login.php
# step 1
# get default cookie of blog and write cookie to cookie1.txt
# step 2
# simulate browser Firefox( of course , you can use any browser agent<!--more--> what you want!) "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
# input your username and also password
# write new cookie to cookie2.txt
curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" -D cookie2.txt -b cookie1.txt -F log=username -F pwd=password -F testcookie=1 -F wp-submit="Log In" -F redirect_to=blog.xrmplatform.org/wp-admin -F submit=login -F rememberme=forever blog.xrmplatform.org/wp-login.php
# currently cookie2.txt stored all cookie info
@antics
antics / stofor.js
Created January 6, 2012 20:25
Josse blandar sig
// importera http-modulen
var http = require('http');
//
// Skapar en webbserver och spottar ut två variabler (objekt),
// request och response, som innehåller en massa rolig information och
// användbara metoder.
//
// request: http://nodejs.org/docs/latest/api/http.html#http.ServerRequest
// response: http://nodejs.org/docs/latest/api/http.html#http.ServerResponse
@antics
antics / stofor.js
Created January 6, 2012 19:49
Stofor 01
// importera http-modulen
var http = require('http');
//
// Skapar en webbserver och spottar ut två variabler (objekt),
// request och response, som innehåller en massa rolig information och
// användbara metoder.
//
// request: http://nodejs.org/docs/latest/api/http.html#http.ServerRequest
// response: http://nodejs.org/docs/latest/api/http.html#http.ServerResponse
@antics
antics / gist:672253
Created November 11, 2010 09:33
Searching a Javascript Array
// Index of
var arr=["one","two","three"];
arr.indexOf('two'); // 1
arr.indexOf('four'); // -1
// Prototyping
Array.prototype.exists = function(o) {
for(var i = 0; i < this.length; i++)
if(this[i] === o)
return true;
@antics
antics / forms.css
Created November 9, 2010 09:36
Form CSS
/* small is for descriptions */
form small { display: block; font-style: italic; }
form label small { display: inline; }
form label, form th label small { display: block; }
form button { display: block; }
@antics
antics / gist:638155
Created October 21, 2010 08:55
jquery.couchdb.js cheatcheet
// Create Database
$.couch.db('db_name').create();
// Save Document
var json_data = {
key: 'value',
another_key: 'another value'
};
$.couch.db('db_name').saveDoc(
json_data,
The Ten Living Principles - Yamas And Niyamas
© Donna Farhi
(Excerpted from Yoga Mind, Body & Spirit: A Return to Wholeness)
Although there are many branches to the tree of yoga, from devotional methods to more intellectual approaches, from schools that emphasize service toward others to those that focus on physical purification, Patanjali Sutras, clearly defines an eight-limbed path (ashtanga) that forms the structural framework for whatever emphasis upon which an individual wishes to concentrate. The Yoga Sutras, or "threads," consist of four books produced sometime in the third century before Christ. Such was the clarity of Patanjali's vision of wholeness that he consolidated the entirety of yoga philosophy in a series of 196 lucid aphorisms. Each thread of the Yoga Sutras is revealed as a part of a woven fabric, with each aphorism merely a mark or color within the whole pattern. The threads, however, begin to make sense only through a direct experience of their meaning. This is not a linear process bu