Skip to content

Instantly share code, notes, and snippets.

@bf4648
bf4648 / vim find
Created June 26, 2021 18:52 — forked from jinzhubaofu/vim find
vim find from hades
'Find' : 'find')<CR>
" Find file in current directory and edit it.
function! Find(name)
let l:list=system("find . -type f | grep -i '".a:name."' | perl -ne 'print \"$.\\t$_\"'")
" let l:list=system("find . -iname '".a:name."' | perl -ne 'print \"$.\\t$_\"'")
" replace above line with below one for gvim on windows
" let l:list=system("find . -name ".a:name." | perl -ne \"print qq{$.\\t$_}\"")
let l:num=strlen(substitute(l:list, "[^\n]", "", "g"))
if l:num < 1
echo "'".a:name."' not found"
@bf4648
bf4648 / helpers.py
Created June 25, 2021 15:15 — forked from kennethreitz/helpers.py
Various Python helper functions
# encoding: utf-8
""" Python General Helpers
Copyright (c) 2010 Kenneth Reitz. Creative Commons Attribution 3.0 License.
"""
import urllib, re, time, sys
import paramiko
@bf4648
bf4648 / com.startup.plist
Created June 24, 2021 04:34 — forked from codeZoner/com.startup.plist
Launch Demon Start up with Bash Script with MySQL Example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- Launch Daemon do not always have access to all the path variables
As a results, scripts will sometimes fail if the you are using path variables inside them
To enable the script to have access to all path variables, open up a terminal and type in -->
<!-- echo $PATH -->
<!-- You can opt to filter out some of the path variables which are not required by script-->
<key>EnvironmentVariables</key>
@bf4648
bf4648 / TextBookSearch.md
Created May 7, 2021 17:44 — forked from cmbaughman/TextBookSearch.md
Searching for Text Books

Note: I found this on the /r/Piracy subreddit (https://www.reddit.com/r/Piracy/comments/3i9y7n/guide_for_finding_textbooks/?sort=confidence) however I am including a copy here just in case.

So you have a list of books you need to buy for college. There are some really great resources for finding them online, but I'm going to run through the easiest methods for searching all of them here.

First, let's start off by using the method that will allow you to find the vast majority of books. Google. It tends to be easier if you can search multiple sites at once, and this is the easiest way to do it.

There was a search engine that /u/ratokursi made 3 years ago, but by now most of the sites are either dead or have changed the url. I decided to make a new one, this time after reviewing 100+ sites and adding to working ones to the custom search engine.

https://cse.google.com/cse/publicurl?cx=011394183039475424659:5bfyqg89ers

@bf4648
bf4648 / crontab_header.sh
Created April 26, 2021 14:48 — forked from wesleyit/crontab_header.sh
A default crontab header that will make the life easier for those who don't remember cron fields or keywords.
## CRONTAB HINTS AND TIPS
##
##
## Entry Description Equivalent To
## @yearly (or @annually) Run once a year at midnight in the morning of January 1 0 0 1 1 *
## @monthly Run once a month at midnight in the morning of the first of the month 0 0 1 * *
## @weekly Run once a week at midnight in the morning of Sunday 0 0 * * 0
## @daily Run once a day at midnight 0 0 * * *
## @hourly Run once an hour at the beginning of the hour 0 * * * *
## @reboot Run at startup @reboot
@bf4648
bf4648 / mamp.md
Last active April 23, 2021 15:21 — forked from jfloff/mamp.md
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you:

@bf4648
bf4648 / tmux.conf
Created April 20, 2021 17:10 — forked from markandrewj/tmux.conf
Basic Tmux Status Bar
# ----------------------
# Status Bar
# -----------------------
set-option -g status on # turn the status bar on
set -g status-utf8 on # set utf-8 for the status bar
set -g status-interval 5 # set update frequencey (default 15 seconds)
set -g status-justify centre # center window list for clarity
# set-option -g status-position top # position the status bar at top of screen
# visual notification of activity in other windows
@bf4648
bf4648 / how-to-setup-eslint-for-meteor.md
Created April 5, 2021 16:52 — forked from lehtu/how-to-setup-eslint-for-meteor.md
How to setup eslint for Meteor project

How to setup eslint for Meteor project

Usage

  • install dependencies
  • setup .eslintrc to the root of your project
  • run eslint .

Dependencies

Install all needed dependencies

@bf4648
bf4648 / ios-sms.sql
Created January 29, 2021 20:43 — forked from duncansmart/ios-sms.sql
Query to extract iOS Messages from backup
-- Do a backup to iTunes and open "%APPDATA%\Apple Computer\MobileSync\Backup\*\3d0d7e5fb2ce288813306e4d4636395e047a3d28" as a SQLite database
SELECT chat.chat_identifier, message.is_from_me, datetime(message.date + 978307201, 'unixepoch') as date, message.text
FROM chat
JOIN chat_message_join on chat.ROWID = chat_message_join.chat_id
JOIN message on message.ROWID = chat_message_join.message_id
order by message.date
unmap x
# Searches
map c Vomnibar.activateInNewTab keyword=d
map ; Vomnibar.activateInNewTab keyword=l
map w Vomnibar.activateInNewTab keyword=w
map t Vomnibar.activateInNewTab keyword=g
map yt Vomnibar.activateInNewTab keyword=y
map a Vomnibar.activateInNewTab keyword=a
map gh Vomnibar.activateInNewTab keyword=gh