This file contains hidden or 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 "ffi" | |
class TimeValue < FFI::Struct | |
layout :seconds, :int, | |
:microseconds, :int | |
end | |
#struct task_basic_info | |
#{ | |
# integer_t suspend_count; |
This file contains hidden or 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
CAIRO_VERSION_STRING = CAIRO_VERSION_MAJOR.CAIRO_VERSION_MINOR.CAIRO_VERSION_MICRO | |
attach_function :cairo_version, [ ], :int | |
attach_function :cairo_version_string, [ ], :string | |
class CairoMatrix < FFI::Struct | |
layout( | |
:xx, :double, | |
:yx, :double, | |
:xy, :double, | |
:yy, :double, | |
:x0, :double, |
This file contains hidden or 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 | |
#Thread.abort_on_exception = true | |
require 'fiber' | |
require 'benchmark' | |
class FiberRing | |
attr_reader :id | |
def initialize(id) | |
@id = id |
This file contains hidden or 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
<!-- index.html --> | |
<html> | |
<head> | |
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> | |
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> | |
<META HTTP-EQUIV="EXPIRES" CONTENT="0"> | |
<META HTTP-EQUIV="REFRESH" CONTENT="0;https://mywebsite.com/ab.007/story.html"> | |
<script type="text/javascript"> | |
window.location = "https://mywebsite.com/ab.007/story.html" | |
</script> |
This file contains hidden or 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 | |
require 'rss' | |
require 'open-uri' | |
require 'net/http' | |
# Your subscription ID | |
sub_id = "xxx" | |
url = "http://railscasts.com/subscriptions/#{sub_id}/episodes.rss" | |
puts "Reading RSS" |
This file contains hidden or 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
shopt -s nocaseglob |
This file contains hidden or 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
# Change to a directory given a full or partial name | |
# You don't have to wrap directory names in quotes either | |
function chd() { | |
friendlyChgDirOptions | |
if [ -n "$1" ]; then | |
if [ -n "`ls "$@"* 2>/dev/null`" ]; then | |
cd "$1"* | |
else | |
echo "-bash: chd: "$1": No directory found from partial name" |
This file contains hidden or 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
$(window).on 'ready page:load', -> | |
# Your code |
This file contains hidden or 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
<html> | |
<head> | |
<title>TabIndex Example - 0</title> | |
</head> | |
<body> | |
This will jump from tab 0 to the address bar. | |
<br /> | |
<label>Tab 0</label> | |
<input tabindex="0" type="text" /> | |
<br /> |
This file contains hidden or 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
<html> | |
<head> | |
<title>TabIndex Example - 1</title> | |
</head> | |
<body> | |
This will jump from tab 1 to tab 2. | |
<br /> | |
<label>Tab 1</label> | |
<input tabindex="1" type="text" /> | |
<br /> |