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
Change Document Root | |
==================== | |
cd /etc/apache2/ | |
sudo cp sites-available/000-default.conf sites-available/mysite.conf | |
sudo vim sites-available/mysite.conf | |
change DocumentRoot and add the following | |
<Directory /home/bhargav/Documents/htdocs/> | |
Options Indexes FollowSymLinks | |
AllowOverride None |
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
Diff two directories | |
==================== | |
diff -qur --exclude="bin" --exclude="gen" DIR_1 DIR_2 | |
-OR- | |
diff --brief \ # -q | |
--unified \ # -u | |
--recursive \ # -r |
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
Change SMS Message center number | |
================================ | |
Android 4.4, Dial *#*#4636#*#* (shows testing screen) |
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
# MAC (wont be able to resume a file if download is stopped in the middle) | |
curl --silent https://developer.apple.com/videos/wwdc/2014/ | egrep -o 'http://devstreaming.apple.com/videos/wwdc/2014/[^/]*/([0-9]+)/\1_hd_[^.]*.mov' | xargs -n1 curl -O | |
# Linux (wget supports resuming, freaking awesome) | |
wget --continue -i $(curl --silent https://developer.apple.com/videos/wwdc/2014/ | egrep -o 'http://devstreaming.apple.com/videos/wwdc/2014/[^/]*/([0-9]+)/\1_hd_[^.]*.mov') |
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
import Foundation | |
protocol ViewModel { | |
typealias ModelType | |
var data: ModelType { get } | |
} | |
struct ViewContainer { | |
var viewModels: [ViewModel] |
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
layout-1 | |
├── Package.swift | |
└── Sources | |
└── ModuleA | |
├── Bar.swift | |
├── Foo.swift | |
└── Tests | |
└── ModuleATests.swift | |
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
$ swift/utils/build-toolchain local.swift | |
./utils/build-script: using preset 'buildbot_linux', which expands to ./utils/build-script --assertions --no-swift-stdlib-assertions --llbuild --swiftpm --xctest --build-subdir=buildbot_linux --lldb --release --test --validation-test --foundation -- --swift-enable-ast-verifier=0 --install-swift --install-lldb --install-llbuild --install-swiftpm --install-xctest --install-prefix=/usr '--swift-install-components=compiler;clang-builtin-headers;stdlib;sdk-overlay;license' --build-swift-static-stdlib=1 --build-swift-stdlib-unittest-extra=1 --skip-test-lldb=1 --test-installable-package=1 --install-destdir=/home/bhargavg/workspaces/swift/swift-nightly-install --installable-package=/home/bhargavg/workspaces/swift/swift-LOCAL-2016-03-13-a-osx.tar.gz --install-foundation --reconfigure | |
Building the standard library for: swift-stdlib-linux-x86_64 | |
Running Swift tests for: check-swift-all-linux-x86_64 | |
cmark: using standard linker | |
+ cd /home/bhargavg/workspaces/build/buildbot_linux |
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/bash | |
# | |
# _ _ | |
# | |__ | |__ __ _ _ __ __ _ __ ___ ____ _ | |
# | '_ \| '_ \ / _` | '__/ _` |/ _` \ \ / / _` | | |
# | |_) | | | | (_| | | | (_| | (_| |\ V / (_| | | |
# |_.__/|_| |_|\__,_|_| \__, |\__,_| \_/ \__, | | |
# |___/ |___/ | |
# | |
# title : script.sh |
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
func makePerson(name: String) -> (age: Int) -> (status: MaritalStatus) -> (requestIDs: [Int]) -> (address: Address) -> Person { | |
return { age in { status in { requestIDs in { address in | |
Person(name: name, age: age, status: status, requestIDs: requestIDs, address: address) | |
}}}} | |
} | |
func makeAddress(flatNo: String) -> (buildingName: String) -> Address { | |
return { buildingName in | |
Address(flatNo: flatNo, buildingName: buildingName) | |
} |
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
[ | |
{ | |
"name": { | |
"first_name": "Lex", | |
"last_name": "Luthor" | |
}, | |
"age": 28, | |
"gender": "male", | |
"address": { | |
"street": "244 Clifton Place", |
OlderNewer