- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git$ nano ~/.zshrc- Add
path=('/path/to/depot_tools' $path)
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
| <script type="text/javascript"> | |
| //Javascript trim() example | |
| String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); }; | |
| //Usage: | |
| var str = " foo bar "; | |
| alert("Original string: '" + str + "'"); | |
| str = str.trim(); | |
| alert("Trimmed string: '" + str + "'"); | |
| </script> |
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
| #include <evhttp.h> | |
| void process_request(struct evhttp_request *req, void *arg){ | |
| struct evbuffer *buf = evbuffer_new(); | |
| if (buf == NULL) return; | |
| evbuffer_add_printf(buf, "Requested: %s\n", evhttp_request_uri(req)); | |
| evhttp_send_reply(req, HTTP_OK, "OK", buf); | |
| } | |
| int main () { |
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
| { type: 'module', | |
| name: 'cluster', | |
| desc: 'The long html description thing at the beginning, examples, etc.', | |
| events: | |
| [ { type: 'event', | |
| name: 'fork', | |
| arguments: [ { name: 'worker', type: 'object', class: 'Worker' } ], | |
| desc: 'blahblah long html description' }, | |
| { type: 'event', | |
| name: 'ready', |
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 net = require('net') | |
| var sock = net.connect(1337) | |
| process.stdin.pipe(sock) | |
| sock.pipe(process.stdout) | |
| sock.on('connect', function () { | |
| process.stdin.resume(); | |
| process.stdin.setRawMode(true) |
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
| // Create our server | |
| var server; | |
| server = http.createServer(function(req,res){ | |
| // Set CORS headers | |
| res.setHeader('Access-Control-Allow-Origin', '*'); | |
| res.setHeader('Access-Control-Request-Method', '*'); | |
| res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET'); | |
| res.setHeader('Access-Control-Allow-Headers', '*'); | |
| if ( req.method === 'OPTIONS' ) { | |
| res.writeHead(200); |
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 redis = require("redis") | |
| , subscriber = redis.createClient() | |
| , publisher = redis.createClient(); | |
| subscriber.on("message", function(channel, message) { | |
| console.log("Message '" + message + "' on channel '" + channel + "' arrived!") | |
| }); | |
| subscriber.subscribe("test"); |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="schwiz.net.weartest" > | |
| <application | |
| android:allowBackup="true" | |
| android:icon="@drawable/ic_launcher" | |
| android:label="@string/app_name" | |
| android:theme="@style/AppTheme" > | |
| <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
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
| /// <reference path="../tsd/tsd.d.ts" /> | |
| import mongoose = require('mongoose'); | |
| import passport = require('passport'); | |
| interface IUser extends mongoose.Document { | |
| provider: string; | |
| id: string; | |
| authorId: string; | |
| displayName: string; |
OlderNewer