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
| Complete installation process: | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| sudo apt-get install -y python-software-properties python make build-essential g++ curl libssl-dev apache2-utils git libxml2-dev | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| cd ~ | |
| mkdir git | |
| cd ~/git |
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
| import { createProxyServer } from 'http-proxy'; | |
| import url from 'url'; | |
| import _ from 'lodash'; | |
| module.exports = app => { | |
| const proxy = createProxyServer(); | |
| app.all('/api/v1/*', (req, res) => { | |
| const path = _.drop(req.url.split('/'), 3); | |
| proxy.proxyRequest(req, res, { | |
| target: url.resolve('YOUR URL', path.join('/')), |
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 python2 | |
| """ | |
| Other Repositories of python-ping | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| * https://github.com/l4m3rx/python-ping supports Python2 and Python3 | |
| * https://bitbucket.org/delroth/python-ping |
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
| """Demonstrates how to construct and send raw Ethernet packets on the | |
| network. | |
| You probably need root privs to be able to bind to the network interface, | |
| e.g.: | |
| $ sudo python sendeth.py | |
| """ | |
| from socket import * |
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
| # Custom cmake target for creating a target using gtest for unit testing. | |
| function(add_gtest_target TARGET_NAME TARGET_LIB) | |
| set(TEST_EXEC _${TARGET_LIB}_test) | |
| # Build the test executable. | |
| add_executable(${TEST_EXEC} ${ARGN}) | |
| target_link_libraries(${TEST_EXEC} ${TARGET_LIB}) | |
| # gtest was not found with a find_package command and must be linked to |
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
| - (void)startBluetoothStatusMonitoring { | |
| // Horrible formatting, but nicer for blog-width! | |
| self.bluetoothManager = [[CBCentralManager alloc] | |
| initWithDelegate:self | |
| queue:dispatch_get_main_queue() | |
| options:@{CBCentralManagerOptionShowPowerAlertKey: @(NO)}]; | |
| } | |
| #pragma mark - CBCentralManagerDelegate |
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
| brew uninstall ideviceinstaller | |
| brew uninstall libimobiledevice | |
| brew install --HEAD libimobiledevice | |
| brew link --overwrite libimobiledevice | |
| brew install ideviceinstaller | |
| brew link --overwrite ideviceinstaller |
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
| // | |
| // main.m | |
| // Protected | |
| // | |
| // Created by Benedict Cohen on 07/03/2012. | |
| // Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
| // | |
| // | |
| // Unlike other object orientated languages Objective-C does not | |
| // provide a mechanism for scoping methods as public, protected or private. |
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
| // App delegate | |
| #import <AVFoundation/AVFoundation.h>// place in .h | |
| // applicationDidFinishLaunchingWithOptions | |
| // [self prepareAudioSession]; | |
| - (BOOL)prepareAudioSession { | |
| // deactivate session |
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
| # -fobjc-arc: enables ARC | |
| # -fmodules: enables modules so you can import with `@import AppKit;` | |
| # -mmacosx-version-min=10.6: support older OS X versions, this might increase the binary size | |
| clang main.m -fobjc-arc -fmodules -mmacosx-version-min=10.6 -o main |
NewerOlder