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
| // example: https://jsfiddle.net/h4gbru7o/ | |
| function InstallMouseCrossHair() { | |
| const color = "#333"; | |
| const size = 24; | |
| const sizePx = size + 'px'; | |
| const sizeHalf = size > 1 ? size / 2 : 0; | |
| const xOffset = 0; | |
| const yOffset = 0; | |
| let frameRequested = 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
| module StringRGB | |
| def rgb(r, g=nil, b=nil) | |
| original = r | |
| if g.nil? | |
| # check for 'short' form values like 0x8cf and expand to 0x88ccff | |
| if r < 4096 | |
| b = r & 0xf | (r << 4 & 0xf0) | |
| g = (r >> 4 & 0xf) | (r & 0xf0) | |
| r = (r >> 8 & 0xf) | (r >> 4 & 0xf0) |
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
| #!/bin/bash | |
| php << 'PHP' | |
| <?php | |
| $f = fopen("packing-test.php.dat", "wb"); | |
| $test = pack('A3d', 'Bob', 0); | |
| fwrite($f, $test); | |
| fclose($f); | |
| PHP | |
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
| # run with: rackup --host 0.0.0.0 dumper.ru | |
| require 'bundler/inline' | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem "shotgun" | |
| gem "rack" | |
| end | |
| require 'json' |
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
| /* | |
| Script for the "Custom JavaScript" chrome extension (https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija) | |
| */ | |
| var BlockContact = function(contactId, callback) { | |
| var magic_cookie = F.config.flickrAPI.auth_hash; | |
| var data = { | |
| magic_cookie: magic_cookie, | |
| done: 1, | |
| id: contactId, | |
| redire: null, |
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 std::fmt; | |
| struct NameBadge { | |
| name: String | |
| } | |
| impl fmt::Display for NameBadge { | |
| fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | |
| write!(f, "Hello, my name is {}", self.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
| # Reference(s): | |
| # - http://kyan.com/blog/2013/10/11/devise-authentication-strategies | |
| # - https://github.com/plataformatec/devise/blob/master/lib/devise/strategies/database_authenticatable.rb | |
| module Devise | |
| module Strategies | |
| class Autologin < Authenticatable | |
| def authenticate! | |
| user = User.first | |
| user ? success!(user) : fail!("No administrator account available") | |
| 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
| echo "Enabling selectable text in quicklook..." | |
| defaults write com.apple.finder QLEnableTextSelection -bool true; killall Finder | |
| echo "Installing QLSteven for quicklook of text files..." | |
| cd ~/Downloads | |
| curl -o QLStephen.qlgenerator.1.4.2.zip "https://github.com/whomwah/qlstephen/releases/download/1.4.2/QLStephen.qlgenerator.1.4.2.zip" | |
| unzip -o "QLStephen.qlgenerator.1.4.2.zip" | |
| sudo cp -R QLStephen.qlgenerator /Library/QuickLook | |
| qlmanage -r |
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
| git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
| echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
| echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
| git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
| source ~/.bashrc | |
| # example for ruby 2.2.2: | |
| # rbenv install 2.2.2 | |
| # - then - | |
| # rbenv local 2.2.2 | |
| # gem install bundler |
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
| #!/bin/sh -e | |
| # JIRA startup script | |
| #chkconfig: 2345 80 05 | |
| #description: JIRA | |
| # Define some variables | |
| # Name of app ( JIRA, Confluence, etc ) | |
| APP=jira | |
| # Name of the user to run as |
NewerOlder