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
// Create a new AppScript project (https://script.google.com/home/start) | |
// and schedule this to be run every hour | |
function markMutedAsRead() { | |
var threads = GmailApp.search('is:muted is:unread'); | |
for (var i = 0; i < threads.length; i++) { | |
threads[i].markRead(); | |
} | |
} |
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
# Special mode for GDB that allows to debug/disassemble REAL MODE x86 code | |
# | |
# It has been designed to be used with QEMU or BOCHS gdb-stub | |
# | |
# 08/2011 Hugo Mercier - GPL v3 license | |
# | |
# Freely inspired from "A user-friendly gdb configuration file" widely available | |
# on the Internet | |
set confirm off |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <malloc.h> | |
int main() { | |
printf("size of size_t: %zu\n", sizeof(size_t)); | |
int i; | |
for (i = 0; i < 10; i++) { | |
size_t size = i * 8; | |
void *m = malloc(size); |
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 | |
URL=http://wiki.qemu-project.org/download/ | |
latest_qemu=$(curl --silent $URL | grep -oP "\bqemu-[0-9.]+\.tar\.bz2\b" | sort | uniq | tail -n 1) | |
basename=$(basename $latest_qemu .tar.bz2) | |
if [[ ! -d $basename ]]; then | |
echo "[+] Downloading latest QEMU: $latest_qemu" | |
wget $URL/$latest_qemu |
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
#!/usr/bin/env python2 | |
import requests | |
import json | |
from pprint import pprint | |
wp_version = '4.3' | |
plugins = [] | |
print '[+] Checking WordPress version ' + wp_version |
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
git push -q -f heroku HEAD:master | |
remote: Compressing source files... done. | |
remote: Building source: | |
remote: | |
remote: -----> Fetching custom git buildpack... done | |
remote: -----> Haskell app detected | |
remote: | |
remote: | |
remote: -----> Welcome to Haskell on Heroku | |
remote: BUILDPACK_URL: https://github.com/mietek/haskell-on-heroku |
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
use std::io; | |
use std::str::FromStr; | |
use std::num::Float; | |
// http://codeforces.com/contest/1/problem/A | |
fn main() { | |
let l = io::stdin().read_line().unwrap(); | |
// We need the .trim() because of the newline. Annoying | |
// Can't do it on one line because of lifetime error. Also annoying. | |
let l = l.trim(); |
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 | |
# This script finds three types of Git repos | |
# 1. Repos that have a dirty index or uncommitted changes | |
# 2. Repos that have committed changes that aren't pushed to the remote branch | |
# 3. Repos that have no remote branch | |
# | |
# Type 2 only works with the master branch, and the others only work with the branch the repo is currently on | |
depth=3 |
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 | |
# A script to log cpu usage, memory usage, and temperature usage | |
# TODO: | |
# | |
# Log temp awk is not portable | |
# Validate interval | |
# |
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
(require 'whitespace) | |
(defun toggle-lines-tail () | |
(interactive) | |
(let ((vic (member 'lines-tail whitespace-style))) | |
(progn | |
(if vic | |
(setq whitespace-style (delete 'lines-tail whitespace-style)) | |
(add-to-list 'whitespace-style 'lines-tail)) | |
(message "%s" whitespace-style)))) |
NewerOlder