type | Regexp |
---|---|
iPhone | .iPhone. |
iPad | .iPad. |
Android | .Android. |
Windows Phone | .Windows Phone. |
BlackBerry | .BlackBerry. |
Symbian | .Symbian. |
IE | .Mozilla/[\d.]+ (compatible; MSIE (\d+). |
Chrome | .Chrome.(\d+). |
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
#if _WIN32_WINNT < 0x0500 | |
# error "should be NT" | |
#endif | |
#include <windows.h> | |
#include <tlhelp32.h> | |
#include <winternl.h> | |
#include <stdio.h> | |
DWORD getppid() | |
{ |
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 be.jedi.dir2floppy; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.FileChannel; | |
import de.waldheinz.fs.FileSystem; | |
import de.waldheinz.fs.FsDirectoryEntry; |
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
public class Stopwatch { | |
public static void main(String[] args){ | |
long startingTime = System.currentTimeMillis(); | |
long currentTime; | |
long deltaTime = 0; | |
long stopTime = 60 * 1000; // 60 seconds in miliseconds | |
while((currentTime = System.currentTimeMillis()) <= startingTime + stopTime){ | |
deltaTime = currentTime - startingTime; | |
System.out.printf("%d miliseconds passed\n", deltaTime); | |
} |
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/sh | |
# Copyright (c) 2012 by Dean Brettle | |
# Licensed under the GPLv3. | |
# To use: | |
# chmod +x 3ds-to-dlna-vob.sh | |
# 3ds-to-dlna-vob.sh yourfile.avi | |
# The horizontal offset between the left and right videos of an object that | |
# should appear on the surface of the screen when viewed in 3D. | |
delta=70 |
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
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd > | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.yifanlu.sshtunnel</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/ssh</string> | |
<string>-T</string> | |
<string>-D</string> |
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
/* | |
This purpose of this Tetris demo is to demostrate three things: | |
1) Structure of a game | |
We have a game loop, a clock, an update method, and a draw method | |
*) The clock calculates the number of seconds since the last loop. | |
This allows us to move the game at a constant pace even if the CPU fluctuates. | |
*) The update method does the logic of the game, including collision checks, random character generation, etc. | |
The update method delegates the task, so each object is responsible for updating itself | |
*) The draw method does the rendering of stuff to screen, and just like the update method, each object draws itself |
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
// | |
// main.c | |
// | |
// Created by Yifan Lu on 8/6/12. | |
// | |
#define G_DIR_SEPARATOR '/' | |
// I don't know if __native_client__ is defined on the Vita or not, so | |
// you can try it both ways. | |
#define __native_client__ |
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
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
;by doppelganger (doppelheathen@gmail.com) | |
;This file is provided for your own use as-is. It will require the character rom data | |
;and an iNES file header to get it to work. | |
;There are so many people I have to thank for this, that taking all the credit for | |
;myself would be an unforgivable act of arrogance. Without their help this would | |
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no |
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
rem ------------------------------------------------------------------------------- | |
rem this file controls the error level returned by the tool robocopy in order to | |
rem be usable in a custom build step of Visual Studio | |
rem ------------------------------------------------------------------------------- | |
robocopy.exe /A-:R /NP /NJH /NJS /NDL /NFL /NS /NC %* | |
rem if errorlevel 16 echo Robocopy Exit Status: ***FATAL ERROR*** & exit /b 1 | |
rem if errorlevel 15 echo Robocopy Exit Status: FAIL MISM XTRA COPY & exit /b 1 | |
rem if errorlevel 14 echo Robocopy Exit Status: FAIL MISM XTRA & exit /b 1 |
OlderNewer