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 markdown previewer by Antonio Ognio <[email protected]> | |
# | |
# Should work in a UNIX-like system using Bash such as GNU/Linux or Mac OS X# | |
# It depends on the uuid and markdown commands. | |
# In Ubuntu just type this: apt-get install uuid markdown | |
# | |
UUID=$(uuid) |
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
<?php | |
function npparse($values) { | |
$result = array(); | |
$result['args'] = array(); | |
$result['kwargs'] = array(); | |
$key = NULL; | |
foreach($values as $v) { | |
if (!is_null($key)) { | |
$result['kwargs'][$key] = $v; |
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
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specifiy | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes |
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
DEBUG:root:Entering the cycle 1/5. | |
DEBUG:root:Key will be deleted when it reaches the value of 10 after 9 increments. | |
DEBUG:root:Key incremented to 2. 8 increment(s) left before the key gets deleted. | |
DEBUG:root:Sleeping for 1 second(s)... | |
DEBUG:root:Key incremented to 3. 7 increment(s) left before the key gets deleted. | |
DEBUG:root:Sleeping for 2 second(s)... | |
DEBUG:root:Key incremented to 4. 6 increment(s) left before the key gets deleted. | |
DEBUG:root:Sleeping for 2 second(s)... | |
DEBUG:root:Key incremented to 5. 5 increment(s) left before the key gets deleted. | |
DEBUG:root:Sleeping for 1 second(s)... |
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 <Cocoa/Cocoa.h> | |
#import <CommonCrypto/CommonDigest.h> | |
@interface NSString (md5) | |
-(NSString *) md5HexDigest; | |
@end |
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.security.MessageDigest; | |
class SHA1Hash { | |
public static String getHexDigest(String str) throws java.security.NoSuchAlgorithmException { | |
MessageDigest md = MessageDigest.getInstance("SHA-1"); | |
return byteArrayToHex(md.digest(str.getBytes())); | |
} | |
public static String byteArrayToHex(byte[] bytes) { |
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.lang.reflect.Field; | |
final class ContainerClass { | |
public static final String some_key = "Hello World"; | |
} | |
public class ReflectionStaticMemberTest { | |
public static void main(String args[]) throws Exception { | |
Field prop = ContainerClass.class.getDeclaredField("some_key"); | |
System.out.println(prop.get(null)); |
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 -*- | |
from htmlentitydefs import codepoint2name | |
def unicode2htmlentities(u): | |
htmlentities = list() | |
for c in u: | |
if ord(c) < 128: | |
htmlentities.append(c) | |
else: |
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 python | |
# -*- encoding: utf8 -*- | |
def escape_unicode_for_xml(str): | |
replacements = ( | |
('<', '<'), | |
('>', '>'), | |
('"', '"'), | |
) |
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
Hi google this is test in order to learn how fast you index Github gists |
OlderNewer