Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.
Edit Xcode Scheme and add a pre-action script.
Copy the contents of preaction.sh into the pre-action script box.
| # See also: http://docs.couchdb.org/en/latest/cluster/index.html | |
| # Before you can add nodes to form a cluster, you have to have them listen on a public ip address | |
| # and set up an admin user (use same admin:password for all nodes). | |
| # Do this, once per node: | |
| # If you have installed couchdb in /opt (else change the Path) | |
| cd /opt/couchdb/etc | |
| cp local.ini local.ini.orig | |
| cp vm.args vm.args.orig |
| class LinkedList { | |
| constructor() { | |
| this.head = null; | |
| this.tail = null; | |
| this.count = 0; | |
| } | |
| get length() { | |
| return this.count; | |
| } |
Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.
Edit Xcode Scheme and add a pre-action script.
Copy the contents of preaction.sh into the pre-action script box.
by Bjørn Friese
Beautiful is better than ugly. Explicit is better than implicit.
I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.
| server { | |
| listen 80; | |
| server_name yournamehere.com; | |
| return 301 https://$host$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; | |
| server_name yournamehere.com; |
| public static bool IsAlmostPalindrome(string word) | |
| { | |
| char[] normal = word.ToCharArray(); | |
| char[] reverse = word.ToCharArray(); | |
| Array.Reverse(reverse); | |
| // Manualmente | |
| //for (int i = normal.Length - 1, j = 0; i >= 0 ; i--, j++) | |
| //{ | |
| // reverse[i] = normal[j]; |
| #!/bin/sh | |
| # script.sh | |
| # Print the date | |
| DATE=`/bin/date +%d-%m-%Y` | |
| NANE="/your/path/$DATA.sql" | |
| HOST="" | |
| USER="" |
| # Plain Ol' Node | |
| node --max-old-space-size=1024 app.js # increase to 1gb | |
| node --max-old-space-size=2048 app.js # increase to 2gb | |
| node --max-old-space-size=3072 app.js # increase to 3gb | |
| node --max-old-space-size=4096 app.js # increase to 4gb | |
| node --max-old-space-size=5120 app.js # increase to 5gb | |
| node --max-old-space-size=6144 app.js # increase to 6gb | |
| # For pm2 | |
| pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb |
| import React, {DeviceEventEmitter} from 'react-native'; | |
| import {Observable} from 'rx-lite' | |
| /** | |
| * Creates an Observable to listen to any event of DeviceEventEmitter | |
| * @param type {string} Event type | |
| */ | |
| export default createObservableFromDeviceEventEmitter$ = type => { | |
| let subscription; | |
| return Observable.fromEventPattern( |
| /** | |
| * This code is licensed under the terms of the MIT license | |
| * | |
| * Deep diff between two object, using lodash | |
| * @param {Object} object Object compared | |
| * @param {Object} base Object to compare with | |
| * @return {Object} Return a new object who represent the diff | |
| */ | |
| function difference(object, base) { | |
| function changes(object, base) { |