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
## | |
# POWERSHELL SPECIFIC | |
## | |
Set-Alias clr clear # slight contraction of clear command | |
function brc { Start notepad "C:\Users\kzimmerman012\Documents\PowerShell\profile.ps1" } # for editing this file | |
function Reload-PowerShell { Start-Process pwsh; exit } # reload PowerShell Core | |
Set-Alias relo Reload-PowerShell | |
function lw { dir | fw } # wide listing | |
function up { cd .. } # better back | |
function rmraf { Remove-Item -Recurse -Force $args[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
//bind onclick to downloadcsv. | |
//o should be the json you want to turn into a table | |
//h should be a string array for the header row, or this can be null and it will use the keys from the first record | |
//n is the name of the file, csv will be appended. if omitted it will just be 'data.csv' | |
export const downloadcsv = (o,h,n = 'data') => { | |
downloadFile( toCSV(o,h) , n + '.csv', 'text/csv' ); | |
} | |
const toCSV = (o,h) => { | |
const a = (v) => `"${v.join(`","`)}"` | |
let csv = [] |
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
// this function will work cross-browser for loading scripts asynchronously | |
function loadScript(src) { | |
return new Promise(function(resolve, reject) { | |
const s = document.createElement('script'); | |
let r = false; | |
s.type = 'text/javascript'; | |
s.src = src; | |
s.async = true; | |
s.onerror = function(err) { | |
reject(err, s); |
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
" Don't try to be vi compatible | |
set nocompatible | |
" Helps force plugins to load correctly when it is turned back on below | |
filetype off | |
" TODO: Load plugins here (pathogen or vundle) | |
" Turn on syntax highlighting | |
syntax on |
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
license: apache-2.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
group 'com.github.yourusername' | |
version '1.0-SNAPSHOT' | |
//These are dependencies that have to do with just the build. See: https://stackoverflow.com/a/23627293/5432315 | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
//This is necessary to use the gradle shadow plugin |
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
// react-native/local-cli/server/util/attachWebsocketServer.js | |
/** | |
* Copyright (c) 2015-present, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
* | |
* @format |
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
from PIL import Image # 导入Pillow的Image模块 | |
IMG = "/Users/fanyer/Downloads/b.png" # 需要处理掉的图片路径 | |
filePath = "/Users/fanyer/test/b.txt" # 处理结果的保存路径 | |
ascii_char = list("$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'. ") | |
height = 45 | |
width = 100 | |
# 重点。将256灰度映射到70个字符上 |
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
from androidhelper import Android | |
from time import sleep | |
import json | |
import urllib2 | |
d = Android() | |
url = "youserver/sms/notify" | |
while(True): | |
messages = d.smsGetMessages(False) | |
for i in messages.result: |
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
let fs = require("fs"); | |
let pako = require("pako"); | |
let str = fs.readFileSync( | |
__dirname + "/903977b432af87d0cfb7766bbe038a8f76ca78" | |
); | |
function Uint8ToString(u8a) { | |
let CHUNK_SZ = 0x800000; | |
let c = []; | |
for (let i = 0; i < u8a.length; i += CHUNK_SZ) { |
NewerOlder