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
// Polling example to reconnect a WebSocket connection. I recommend NOT using this in your app. | |
function createWebSocket () { | |
var connection = new WebSocket(); | |
connection.onclose = function () { | |
setTimeout(function () { | |
// Connection has closed so try to reconnect every 10 seconds. | |
createWebSocket(); | |
}, 10*1000); |
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 "YourViewController.h" | |
#import <QuartzCore/QuartzCore.h> // required to modify the corner radius | |
//.....Setup your controller... | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
self.myView.layer.cornerRadius = 8; //add a corner radius to the UILabel | |
} |
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
$(document).ready(function() { | |
var embedGist = function () { | |
$('a[href^="https://gist.github.com"]').each(function(i) { | |
if (writeCapture) { | |
var wrapper = $("<div></div>"); | |
wrapper.insertAfter(this); | |
writeCapture.html(wrapper[0], '<script src="'+$(this).attr("href")+'.js"></script>'); | |
$(this).remove(); | |
} 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
#pragma unused(parameterName) |
This file has been truncated, but you can view the full file.
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
{ | |
"/src/js/bindingHandlers/include.js": { | |
"lineData": [ | |
null, | |
4, | |
null, | |
null, | |
null, | |
4, | |
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
void strrev(char *p) { | |
char *q = p; | |
while(q && *q) ++q; //get last char of the string | |
for(--q; p < q; ++p, --q) { | |
*p = *p ^ *q, //xor p | |
*q = *p ^ *q, // xor np w/ q to store p's value in q | |
*p = *p ^ *q; //xor np w/ nq to get q's original value in p | |
} | |
} |
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
class Reverse { | |
public static void main(String[] args) { | |
reverse("abcde"); | |
} | |
public static void reverse(String str){ | |
char[] str_arr = str.toCharArray(); | |
int start = 0, | |
end = str_arr.length-1; |
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
template "/etc/sysconfig/iptables" do | |
source "iptables.erb" | |
owner "root" | |
group "root" | |
mode "0600" | |
end | |
# Ensure that the iptables file adheres to the selinux requirements | |
execute "chcon" do | |
command "chcon system_u:object_r:system_conf_t:s0 /etc/sysconfig/iptables" |
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
args = ['-f', 'my_build.xml', 'my_target1'] | |
task :call_ant do | |
ant args | |
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
# -*- encoding: utf-8 -*- | |
$:.push File.expand_path("../lib", __FILE__) | |
require 'mygem/version' | |
Gem::Specification.new do |s| | |
s.name = "MyGem" | |
s.version = MyGem::VERSION | |
s.authors = ["strife25"] | |
s.email = [""] |