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
angular.module('pingService', []) | |
.factory('ping', ['$http', function($http) { | |
// Pings a URL or IP using HTTP GET request | |
return { | |
ping: function(URL, callback) { | |
var responseTime = 0; |
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 { ChartModule } from 'angular2-highcharts'; | |
import { HighchartsStatic } from 'angular2-highcharts/dist/HighchartsService'; | |
import * as highcharts from 'highcharts'; | |
export function highchartsFactory() { | |
return highcharts; | |
} | |
imports: [ | |
ChartModule | |
], |
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
fetch(cb) { | |
const req = new XMLHttpRequest(); | |
req.open('GET', `assets/data/company.json`); | |
req.onload = () => { | |
cb(JSON.parse(req.response)); | |
}; | |
req.send(); |
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
# Download latest Android image, "hammerhead" for Nexus 5 (GSM/LTE) | |
https://developers.google.com/android/nexus/images#hammerhead | |
# Download latest TWRP | |
https://dl.twrp.me/hammerhead/ | |
# Download latest SuperSu | |
https://download.chainfire.eu/supersu | |
Enable USB debugging. |
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
http://www.jianshu.com/p/94afa6c4dbc1 | |
#实现: | |
添加文件app/core/common/local.storage.ts(文件位置根据自己喜好) | |
import {Provider} from '@angular/core'; | |
export class LocalStorage { | |
public localStorage:any; |
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/python | |
# This file has no update anymore. Please see https://github.com/worawit/MS17-010 | |
from impacket import smb, ntlm | |
from struct import pack | |
import sys | |
import socket | |
''' | |
EternalBlue exploit for Windows 8 and 2012 by sleepya | |
The exploit might FAIL and CRASH a target system (depended on what is overwritten) |
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
# Airbnb JavaScript 代码规范() { | |
*一种写JavaScript更合理的代码风格。* | |
> **Note**: 本指南假设你使用了 [Babel](https://babeljs.io), 并且要求你使用 [babel-preset-airbnb](https://npmjs.com/babel-preset-airbnb) 或者其他同等资源。 并且假设你在你的应用中安装了 shims/polyfills ,使用[airbnb-browser-shims](https://npmjs.com/airbnb-browser-shims) 或者相同功能。 | |
[](https://www.npmjs.com/package/eslint-config-airbnb) | |
[](https://www.npmjs.com/package/eslint-config-airbnb-base) | |
[](https://gitter.im/airbnb/javascript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) |
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
const fs = require('fs') | |
const filename = process.argv.slice(2)[0] | |
function hexdump(filename) { | |
let buffer = fs.readFileSync(filename) | |
let lines = [] | |
for (let i = 0; i < buffer.length; i += 16) { | |
let address = i.toString(16).padStart(8, '0') // address | |
let block = buffer.slice(i, i + 16) // cut buffer into blocks of 16 |
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
// The biggest 64bit prime | |
#define P 0xffffffffffffffc5ull | |
#define G 5 | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
// calc a * b % p , avoid 64bit overflow |