<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>HTML5 Boilerplate: The web's most popular front-end template</title>
<meta name="description" content="HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites. Spend more time developing and less time reinventing the wheel.">
This file contains 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
// connect to a Bluetooth device from Android | |
Socket socket = null; | |
try { | |
device.createRfcommSocketToServiceRecord(MY_UUID); | |
Method m = device.getClass().getMethod("createRfcommSocket", new Class[] {int.class}); | |
socket = (BluetoothSocket) m.invoke(device, 1); | |
} catch (IOException e) { | |
Log.e(TAG, "create() failed", e); | |
} |
This file contains 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
#!/bin/sh -e | |
# | |
# Put this script in /path/to/project/local/upgrade.sh | |
# and customize if necessary | |
cd $(dirname "$0")/.. | |
projectname=$(basename $(pwd)) | |
. ~/virtualenv/$projectname/bin/activate |
This file contains 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
#!/bin/sh | |
# 1. Create symlinks to the real upgrade scripts for each branch, for example: | |
# ./upgrade-beta.sh # will only be called when "beta" branch is updated | |
# ./upgrade-prod.sh # will only be called when "prod" branch is updated | |
# | |
# 2. Put these symlinks in the repository root, NOT in the hooks/ directory | |
# the post-receive hook receives parameters on stdin | |
while read oldrev newrev refname |
This file contains 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
# go to the directory where the site is deployed | |
cd ~/project/dir | |
# initialize empty Git repo for release purposes | |
git init --bare ~/repos/git/releases/project.git | |
# add the repo as a remote called "releases" | |
git remote add releases ~/repos/git/releases/project.git | |
# create the "beta" branch locally and switch to it |
This file contains 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
<playercorefactory> | |
<players> | |
<player name="VLC" type="ExternalPlayer" video="true"> | |
<filename>/usr/bin/vlc</filename> | |
<args>--play-and-exit --video-on-top --fullscreen</args> | |
<forceontop>false</forceontop> | |
<hidexbmc>false</hidexbmc> | |
<hideconsole>false</hideconsole> | |
<hidecursor>false</hidecursor> | |
</player> |
Cool things other editors can't do or not easily, but easy in vim.
Create a macro to replace all occurences of:
{% url package.module.method %}
with:
{% url 'package.module.method' %}
- Gists: random notes, code snippets, syntax highlighting, version control, clone
- Embedding Gists in your blog, syntax highlighting
- New repo at an instance
- wiki
- In-browser editing
- issue tracking even for projects NOT on github
- code reviews
- gh-pages
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
void rearrange(int *numbers, int index, int num) { | |
int tmp; | |
for (int i = index; i < num; ++i) { | |
tmp = numbers[index]; | |
numbers[index] = numbers[i]; | |
numbers[i] = tmp; | |
rearrange(numbers, index + 1, num); |
This file contains 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
-showlocation | |
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient | |
-Dhttp.proxyPort=8080 | |
-Dhttp.proxyHost=the_ip_address | |
-Dhttp.proxyUser=the_username | |
#-Dhttp.proxyPassword=only_enter_temporarily_when_needed_and_remove_after | |
-Xms512m | |
-Xmx912m |