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
require "net/http" | |
require "websocket" | |
store = OpenSSL::X509::Store.new | |
store.set_default_paths | |
ctx = OpenSSL::SSL::SSLContext.new(:TLSv1_2_client) | |
ctx.set_params(verify_mode: OpenSSL::SSL::VERIFY_PEER) | |
ctx.cert_store = store | |
sock = OpenSSL::SSL::SSLSocket.open( |
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
# brew install fzf | |
# brew install yq | |
# Add below line to `~/.aliases` | |
alias pick_targets="cat kochiku.yml | yq e '.targets[].type' - | fzf -m | tr '\n' ',' | sed 's/,$/\n/'" |
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
test12 |
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
test |
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
(function(API){ | |
API.myText = function(txt, options, x, y) { | |
options = options ||{}; | |
/* Use the options align property to specify desired text alignment | |
* Param x will be ignored if desired text alignment is 'center'. | |
* Usage of options can easily extend the function to apply different text | |
* styles and sizes | |
*/ | |
if( options.align == "center" ){ | |
// Get current font size |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
lineItems: [], | |
init() { | |
this._super(...arguments); | |
this.lineItems.push(11); | |
this.lineItems.push(22); | |
this.lineItems.push(33); |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
ourValue: 1, | |
actions: { | |
increse: function() { | |
this.set('ourValue', 1 + Math.abs(this.get('ourValue'))); | |
}, | |
onkeyup: function(e) { |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
actions: { | |
YES() { | |
this.sendAction('YES'); | |
}, | |
NO() { | |
this.sendAction('NO'); | |
}, |
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
<?php | |
$txtOrig = $txt = file_get_contents('bad.txt'); | |
function test($str) { | |
preg_replace_callback("/test/u", function($matches) { return ''; }, $str); | |
return preg_last_error() === 4 /* PREG_BAD_UTF8_ERROR */; | |
} | |
$i = 0; |
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
package colors; | |
import java.awt.*; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import javax.imageio.ImageIO; |
NewerOlder