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
use sdl2::video::Window; | |
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle}; | |
use raw_window_handle::AppKitHandle; | |
pub struct WindowWrapper<'a>(pub &'a Window); | |
unsafe impl<'a> HasRawWindowHandle for WindowWrapper<'a> { | |
#[cfg(not(target_os = "macos"))] | |
/// all non-mac platforms work correctly, so return the handle directly | |
fn raw_window_handle(&self) -> RawWindowHandle { |
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/nodejs | |
//var regexRegex = /^\/([^\/]|(\\\/))*\/[gimy]*/; | |
var regexRegex = /^\/([^\/]|(\\\/))*\/[gimy]*/; | |
var regexRegexAsString = '^/([^\/]|(\\/))*/[gimy]*'; | |
var notQuiteRegexRegex = /^"([^\/]|(\\"))*"[gimy]*/; | |
var notQuiteRegexSearchString = '"hello world\\" hows it going?"igmyi'; | |
var regexSearchString = notQuiteRegexSearchString.replace(/"/g,'/'); |
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
var Heap = (function(){ | |
function otheri(index, level_offset){ | |
var level = Math.floor(Math.log2(index+1)); | |
var level_start = Math.pow(2, level) - 1; | |
var offset = index - level_start; | |
var other_level_start = Math.pow(2, level + level_offset) -1; | |
var other_offset = Math.floor(offset * Math.pow(2, level_offset)); | |
return other_level_start + other_offset; | |
}; | |
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
https://xkcd.com/ | |
http://www.schlockmercenary.com | |
http://axecop.com/ | |
http://www.gunnerkrigg.com/ | |
http://avasdemon.com/ | |
http://www.smbc-comics.com/ | |
http://www.qwantz.com/index.php | |
http://www.lackadaisycats.com/ | |
http://thepunchlineismachismo.com/ | |
http://www.darthsanddroids.net/ |
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
Traceback (most recent call last): | |
File "/usr/lib/python2.6/site-packages/ansible/runner/connection_plugins/paramiko_ssh.py", line 330, in close | |
self.ssh.load_system_host_keys() | |
File "/usr/lib/python2.6/site-packages/paramiko/client.py", line 149, in load_system_host_keys | |
self._system_host_keys.load(filename) | |
File "/usr/lib/python2.6/site-packages/paramiko/hostkeys.py", line 155, in load | |
e = HostKeyEntry.from_line(line) | |
File "/usr/lib/python2.6/site-packages/paramiko/hostkeys.py", line 67, in from_line | |
key = RSAKey(data=base64.decodestring(key)) | |
File "/usr/lib/python2.6/site-packages/paramiko/rsakey.py", line 61, in __init__ |
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
#include <stdio.h> | |
#include <stdint.h> | |
int main(int argc, char** argv){ | |
char cow2[5][4]; | |
cow2[3][4] = 10; | |
cow2[0][0] = 1; | |
cow2[0][1] = 2; | |
printf("moo:%i\n", *((char*) cow2+(4*3+4))); | |
return 0; | |
} |
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
#include <stdio.h> | |
#include <stdint.h> | |
int main(int argc, char** argv){ | |
char cow2[5][4]; | |
cow2[3][4] = 10; | |
cow2[0][0] = 1; | |
cow2[0][1] = 2; | |
printf("moo:%i\n", *((char*) cow2+(4*3+4))); | |
return 0; | |
} |
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
create or replace function subnet_hosts(subnet cidr) returns setof inet as $$ | |
declare | |
host inet := (inet (host(network(subnet)))); | |
broadcast inet := (inet (host(broadcast(subnet)))); | |
begin | |
if family(subnet) = 4 then | |
-- /32's are a special case | |
if masklen(subnet) = 32 then | |
return next subnet; | |
return; |
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
# Currently the pattern used when implementing a params class is something like this. | |
# It works but is very verbose for what it does. | |
class puppet::params{ | |
# In this case we are only specializing based on one parameter | |
case $::osfamily { | |
'Debian': { | |
$conf_file_path = '/etc/puppet/puppet.conf' | |
} | |
default: { |
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
root@scootaloo:/var/log# cat auth.log | cut -b -6 | sort | uniq -c | |
4631 Mar 10 | |
2097 Mar 11 | |
2780 Mar 12 | |
1584 Mar 13 | |
2520 Mar 14 | |
3782 Mar 9 |
NewerOlder