This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| [ | |
| { | |
| "keys": ["alt+w"], | |
| "command": "toggle_setting", | |
| "args": | |
| { | |
| "setting": "word_wrap" | |
| } | |
| } | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var user = { | |
| validateCredentials: function (username, password) { | |
| return ( | |
| (!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
| : (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
| : (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
| : (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
| : (!/^([a-z0-9-_]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
| : false | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # requires root permissions in /usr/bin/ | |
| star = String.new | |
| 8.times { star += "*" } | |
| Star = "\n#{star * 3}\n" | |
| def newblock string | |
| puts "\n#{Star}#{string}#{Star}\n" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| #-*- coding: utf-8 -*-# | |
| import smtplib, time, urllib2 | |
| from bs4 import BeautifulSoup | |
| from email.mime.text import MIMEText | |
| def mailme(message): | |
| msg = MIMEText(message) | |
| msg['Subject'] = 'German Consu Termin!' | |
| msg['From'] = '[email protected]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g} | |
| require File.join(File.dirname(__FILE__), "downmark_it") | |
| module WordPress | |
| def self.import(database, user, password, table_prefix = "wp", host = 'localhost') | |
| db = Sequel.mysql(database, :user => user, :password => password, :host => host, :encoding => 'utf8') | |
| %w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Helper function, used below. | |
| // Usage: ['img1.jpg','img2.jpg'].remove('img1.jpg'); | |
| Array.prototype.remove = function(element) { | |
| for (var i = 0; i < this.length; i++) { | |
| if (this[i] == element) { this.splice(i,1); } | |
| } | |
| }; | |
| // Usage: $(['img1.jpg','img2.jpg']).preloadImages(function(){ ... }); | |
| // Callback function gets called after all images are preloaded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| General principles for good URI design: | |
| Don't use query parameters to alter state | |
| Don't use mixed-case paths if you can help it; lowercase is best | |
| Don't use implementation-specific extensions in your URIs (.php, .py, .pl, etc.) | |
| Don't fall into RPC with your URIs | |
| Do limit your URI space as much as possible | |
| Do keep path segments short | |
| Do prefer either /resource or /resource/; create 301 redirects from the one you don't use | |
| Do use query parameters for sub-selection of a resource; i.e. pagination, search queries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <!-- Encoding --> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame --> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Fixing the postgresql initdb fatal shared memory error on Leopard | |
| Published Tue 18 December 2007 11:09 (+1300) | |
| Tagged | |
| software (43 posts and 3 photos) | |
| mac os x (6 posts) | |
| When doing the post-install setup of postgresql default database using initdb, you may hit this error: | |
| FATAL: could not create shared memory segment: Cannot allocate memory | |
| DETAIL: Failed system call was shmget(key=1, size=1646592, 03600). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ++[>++++++++++[>++++++++++[>++++++++++[>++++++++++<-]<-]<-]<-]>+++++[>++++++++++[>++++++++++[>++++++++++<-]<-]<-]>>++++++++++[>++++++++++<-]>+++++.<<<++++[>++++++++++[>++++++++++[>++++++++++<-]<-]<-]>++[>++++ ++++[>++++++++<-]<-]>>.>+++++++++[>++++++++++[>++++++++++[>++++++++++<-]<-]<-]+++++++++[>+++++++++<-]>[>>-<<-]>>------[<<<<->>>>-]<<<<. |