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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 <unistd.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <string.h> | |
static int xread(int fd, void* buf, size_t len) | |
{ | |
int r; |
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
<?xml version="1.0"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<match target="font"> | |
<edit name="antialias" mode="assign"> | |
<bool>true</bool> | |
</edit> | |
</match> |
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 <unistd.h> | |
#include <time.h> | |
#define PIPE_PROGRESS_SIZE 4096 | |
/* Read a block of data from stdin, write it to stdout. | |
* Activity is indicated by a '.' to stderr | |
*/ |
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 <bitset> | |
#include <iostream> | |
template <size_t N> | |
using GrayCode = std::bitset<N>; | |
// Construct the binary-reflected Gray code iteratively. | |
template <size_t N> | |
class GrayCodeGenerator { | |
public: |
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 | |
USERNAME=username | |
PASSWORD=password | |
REPO="svn://192.168.0.30/svn/trunk/android" | |
APK="pkg1 pkg2 pkg3 pkg4" | |
OUTDIR=$HOME/build.apk | |
BUILDLOG=buildlog |
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 | |
die() { | |
cat << EOF | |
usage: $(basename $0) secs [timezone] | |
30m = 1800s 1h = 3600s 4h = 14400s 7h = 25200s | |
90m = 5400s 2h = 7200s 5h = 18800s 8h = 28800s | |
120m = 7200s 3h = 10800s 6h = 21600s 9h = 32400s |
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 | |
USERNAME=username | |
PASSWORD=password | |
REPO="svn://192.168.0.30/svn/trunk" | |
FW="project" | |
OUTDIR=$HOME/build.fw | |
BUILDLOG=buildlog |
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 <string.h> | |
int convert(const char *var, FILE *in, FILE *out) { | |
char buf[256]; | |
char fmt[16] = { 0 }; | |
int width = 0, height = 0, depth = 0; | |
fgets(buf, sizeof(buf), in); // format |
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/python | |
import os | |
import re | |
import shutil | |
def removeall(path): | |
if os.path.islink(path): | |
os.unlink(path) | |
return |
OlderNewer