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
struct OBJECT{ // The object to be serialized / deserialized | |
public: | |
// Members are serialized / deserialized in the order they are declared. Can use bitpacking as well. | |
DATATYPE member1; | |
DATATYPE member2; | |
DATATYPE member3; | |
DATATYPE member4; | |
}; | |
void write(const std::string& file_name, OBJECT& data) // Writes the given OBJECT data to the given file name. |
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
import struct | |
import math | |
import os | |
import sys | |
if sys.version > '3': | |
buffer = memoryview | |
def getWord(b, k, n=4): | |
return sum(list(map(lambda c: b[k+c]<<(c*8),range(n)))) |
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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
using System.IO.MemoryMappedFiles; | |
using System.IO; |
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
package main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"math" |
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
/* Written by Amit Agarwal amit@labnol.org */ | |
/* Tutorial: http://www.labnol.org/?p=25153 */ | |
var folder, folder_name = "Google Voice"; | |
var archive, gmail_label = "MP3"; | |
/* Find Google Voice messages in Gmail */ | |
var filter = "from:voice-noreply@google.com -label:" + gmail_label; | |
var threads = GmailApp.search(filter, 0, 10); |
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
import java.util.Map; | |
import java.util.Comparator; | |
import java.util.Collections; | |
int index = 0; | |
// sprite sheet | |
PImage pokemon; | |
// current pokemon sprite | |
PImage current; | |
// current pie chart |
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
--taken from http://benguild.com/2012/04/11/how-to-import-tasks-to-do-items-into-ios-reminders/#comment-1346894559 | |
--set theFileContents to (read file "Users:n8henrie:Desktop:Reminders.txt") -- Change this to the path to your downloaded text file with your tasks in it! (Note the : instead of a / between folders) Or, just name them Reminders.txt and put them in your downloads folder | |
--set theLines to paragraphs of theFileContents | |
set theLines to {"task name 1", "task name 2"} | |
repeat with eachLine in theLines | |
tell application "Reminders" | |
set mylist to list "Your List Name" | |
tell mylist | |
make new reminder at end with properties {name:eachLine, due date:date "7/10/2014 3:00 PM"} |
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
internal static byte[,] shuffle_order = new byte[,] | |
{{0,1,2,3},{0,1,3,2},{0,2,1,3},{0,2,3,1},{0,3,1,2},{0,3,2,1},{1,0,2,3},{1,0,3,2}, | |
{1,2,0,3},{1,2,3,0},{1,3,0,2},{1,3,2,0},{2,0,1,3},{2,0,3,1},{2,1,0,3},{2,1,3,0},{2,3,0,1}, | |
{2,3,1,0},{3,0,1,2},{3,0,2,1},{3,1,0,2},{3,1,2,0},{3,2,0,1},{3,2,1,0}}; | |
internal static byte[,] inv_shuffle_order = new byte[,] | |
{{0,1,2,3},{0,1,3,2},{0,2,1,3},{0,3,1,2},{0,2,3,1},{0,3,2,1},{1,0,2,3},{1,0,3,2},{2,0,1,3}, | |
{3,0,1,2},{2,0,3,1},{3,0,2,1},{1,2,0,3},{1,3,0,2},{2,1,0,3},{3,1,0,2},{2,3,0,1},{3,2,0,1}, | |
{1,2,3,0},{1,3,2,0},{2,1,3,0},{3,1,2,0},{2,3,1,0},{3,2,1,0}}; |
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 ruby | |
# Based on everwatch.rb by Brett Terpstra, 2011, a 2013 update by spetschu, and a 2014 update by regedor | |
# Write in Markdown in Evernote and Backup Markdown files in Dropbox | |
# Change the next two lines with your account number and the path to your backup folder | |
watch_folder = File.expand_path("/Users/USERNAME/Library/Containers/com.evernote.Evernote/Data/Library/Application Support/com.evernote.Evernote/accounts/www.evernote.com/YOUR-ACCOUNT-NUMBER/content/") | |
mark_folder = "~/Dropbox/Evernotes/" | |
counter = 0 |
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 | |
# Workflow script available here: http://bit.ly/1PEvd1S | |
import platform | |
if platform.system() == 'Darwin': | |
if platform.machine().startswith('iP'): | |
import console | |
import clipboard | |
import webbrowser |
OlderNewer