👨👩👧👦
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 <gdal_priv.h> | |
| #include <cpl_conv.h> | |
| #include <stdio.h> | |
| uint32_t htonf(float f){ | |
| uint32_t p; | |
| uint32_t sign = 0; | |
| if (f < 0) { f = 0; } // floor |
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
| glEnabled: function() { | |
| try { | |
| return !!window.WebGLRenderingContext && | |
| (!!document.createElement('canvas').getContext('experimental-webgl') || | |
| !!document.createElement('canvas').getContext('webgl')); | |
| } catch(e) { | |
| return false; | |
| } | |
| } |
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
| (function(){ | |
| var State = function(name) { | |
| this.name = name; | |
| }; | |
| State.prototype.from = function(from) { | |
| this.from_ = from; | |
| return this; | |
| }; |
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 lum = function(hex) { | |
| var bits = hex.match(/([0-9a-f]{2})/ig).map(function(i){ | |
| var it = parseInt(i, 16) / 255; | |
| if(it < 0.03928) | |
| return it / 12.92; | |
| else | |
| return Math.pow((it + 0.055) / 1.055, 2.4); | |
| }); | |
| return 0.2126 * bits[0] + 0.7152 * bits[1] + 0.0722 * bits[2]; | |
| }; |
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
| @font-face { | |
| font-family: 'StateFaceRegular'; | |
| src: url(<%= asset_path 'stateface-regular-webfont.eot' %>); | |
| src: url(<%= asset_path 'stateface-regular-webfont.eot?#iefix' %>) format('embedded-opentype'), | |
| url(<%= asset_path 'stateface-regular-webfont.woff' %>) format('woff'), | |
| url(<%= asset_path 'stateface-regular-webfont.ttf' %>) format('truetype'), | |
| url(<%= asset_path 'stateface-regular-webfont.svg#StateFaceRegular' %>) format('svg'); | |
| font-weight: normal; | |
| font-style: normal; | |
| } |
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 alpha = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); | |
| function convert(string){ | |
| var pow = 0; | |
| var res = 0; | |
| while(pow < string.length){ | |
| res += (alpha.indexOf(string.split("")[pow]) + 1) * Math.pow(37, pow); | |
| pow++; | |
| } | |
| return res; |
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
| # you're fucking kidding me with this shit rails | |
| def sort_string(sort, by) | |
| sort = Model.column_names.include?(sort) ? sort : 'field' | |
| by = ['asc', 'desc'].include?(by) ? by : 'desc' | |
| "#{sort} #{by}" | |
| end | |
| # use: Model.order(sort_string sort, by) |
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
| // Types | |
| var one = 1; | |
| var two = 2; | |
| three; | |
| window.three; | |
| window.one = 1; | |
| one = 1; | |
| var one = []; | |
| var one = {one: 1}; | |
| one.two = 1; |
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 'thread' | |
| class Pool | |
| def initialize(csv, get, set) | |
| @get = get | |
| @set = set | |
| @csv = csv | |
| @queue = Queue.new | |
| @mutex = Mutex.new | |
| end |
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
| def min_hash! | |
| min = Infinity | |
| freq.keys.each do |key| | |
| min = key.hash if key.hash < min | |
| end | |
| self.min_hash = min == Infinity ? 0 : min | |
| end |