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
const fib = (num) => { | |
if (num <= 0) return 0; | |
if (num === 1 || num === 2) return 1; | |
if (num > 2) { | |
let prev = 1, next = 1; | |
for (let i = 3; i <= num; i++) { | |
let sum = prev + next; | |
prev = next; | |
next = sum; | |
} |
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
<snippet> | |
<content><![CDATA[ | |
console.log($1); | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>log</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.ts</scope> | |
</snippet> |
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 | |
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport |
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
# -*- coding:utf-8-*- | |
from __future__ import with_statement | |
import os,sys | |
def find_condition(filename,condition): | |
with open(filename) as f: | |
for i in f: | |
i = i.strip() | |
data = i.split('|') | |
if condition == data[2]: |
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
# encoding: utf-8 | |
import hashlib | |
import sys | |
if __name__ == '__main__': | |
i = bytes(sys.argv[1],'utf8') | |
k = hashlib.md5(i).hexdigest() | |
print(k) |