Skip to content

Instantly share code, notes, and snippets.

View netcookies's full-sized avatar
💭
I may be slow to respond.

Isulew netcookies

💭
I may be slow to respond.
View GitHub Profile
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@horsley
horsley / index.php
Created January 4, 2014 06:14
sms + tasker转发服务的脚本
<?php
define('APP_PATH', dirname(__FILE__));
define('DATA_FILE', APP_PATH. '/sms.htdata');
if ($_SERVER['REQUEST_METHOD'] == 'POST') { //tasker提交
if (!isset($_POST['c'])) {
die('Invalid Request!');
} else {
$data = '';
if (file_exists(DATA_FILE)) { //读入已有数据
@cosimo
cosimo / parse-options.sh
Created September 21, 2012 09:31
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
Subject: Thanks for signing up!
Date: {{date}}
To: {{recipient}}
From: {{sender}}
MIME-Version: 1.0
Content-Type: text/plain
Thanks for signing up for the Foobar service!
Your email address is: {{recipient}}
@bkeating
bkeating / howto-filemerge-git-osx.md
Created March 11, 2010 21:36
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.