Skip to content

Instantly share code, notes, and snippets.

View fr0gs's full-sized avatar
🐧

Esteban fr0gs

🐧
View GitHub Profile
//ROUTER
//Silly small javascript router to help me learn how they worked in a very simple way
(function (){
const appDiv = "app";
// Both set of different routes and template generation functions
let routes = {};
let templates = {};
/usr/local/bundle/gems/rdf-raptor-1.99.0/lib/rdf/raptor/ffi/v2/parser.rb:209: [BUG] Segmentation fault at 0x00000000000000
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0064 p:---- s:0324 e:000323 CFUNC :raptor_parser_parse_chunk
c:0063 p:0018 s:0317 E:002558 METHOD /usr/local/bundle/gems/rdf-raptor-1.99.0/lib/rdf/raptor/ffi/v2/parser.rb:209
c:0062 p:0025 s:0313 E:0025a8 RESCUE /usr/local/bundle/gems/rdf-raptor-1.99.0/lib/rdf/raptor/ffi/v2/parser.rb:163
c:0061 p:0056 s:0310 E:000a90 METHOD /usr/local/bundle/gems/rdf-raptor-1.99.0/lib/rdf/raptor/ffi/v2/parser.rb:157
c:0060 p:0175 s:0303 E:000c98 METHOD /usr/local/bundle/gems/rdf-raptor-1.99.0/lib/rdf/raptor/ffi/v2/parser.rb:92
c:0059 p:0018 s:0297 E:001d90 METHOD /usr/local/bundle/gems/rdf-raptor-1.99.0/lib/rdf/raptor/ffi.rb:118
import Ember from 'ember';
import FileField from 'ember-uploader/file-field';
var AttachmentFileUploadComponent;
AttachmentFileUploadComponent = FileField.extend({
multiple: true,
attributeBindings: ["capture", "accept"],
accept: "accept='image//*'",
capture: "camera",
changedFiles: Ember.observer('files', function() {
var files;
files = this.get('files');
if (!Ember.isEmpty(files)) {
this.sendAction('filesChanged', files);
return this.rerender();
}
})
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
mappings: undefined,
computedMappings: Ember.computed('mappings', function() {
let mappings = this.get('mappings');
return mappings;
}),
init: function() {
@fr0gs
fr0gs / tcptrace-time-to-secs
Last active August 29, 2015 14:17
Crappy code to read a pcap file with tcptrace and convert elapsed time into seconds
TIMEZ=$(tcptrace -l $PCAP 2>/dev/null | awk 'NR==15 {print $3}') # Got a time value like 00:00:
OIFS="$IFS"
IFS=':'
read -a tokenized <<< "${TIMEZ}"
IFS="$OIFS"
HOUR=( "${tokenized[0]}" )
MIN=( "${tokenized[1]}" )
SEC=( "${tokenized[2]}" ) #To reassign a variable assigned
RES=$(echo "scale = 6; 3600*$HOUR+60*$MIN+$SEC" | bc)