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 | |
$curl = curl_init(); | |
curl_setopt_array($curl, [ | |
CURLOPT_URL => "https://api.github.com/repos/ivoryworks/til/issues/1", | |
CURLOPT_HTTPHEADER => [ | |
"User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 YaBrowser/16.3.0.7146 Yowser/2.5 Safari/537.36" | |
] | |
]); | |
echo curl_exec($curl); | |
curl_close($curl); |
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
SharedPreferences mPreferences = getActivity().getSharedPreferences("private_pref", Context.MODE_PRIVATE); | |
// Read | |
mPreferences.getInt(PREF_VALUE, 1); | |
// Write | |
SharedPreferences.Editor editor = mPreferences.edit(); | |
editor.putInt(PREF_VALUE, 1); | |
editor.apply(); |
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
from xpcom import components | |
viewSvc = components.classes["@activestate.com/koViewService;1"]\ | |
.getService(components.interfaces.koIViewService) | |
view = viewSvc.currentView.queryInterface(components.interfaces.koIScintillaView) | |
sm = view.scimoz | |
sm.currentPos # current position in the editor | |
sm.text # editor text | |
sm.selText # the selected text |
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 | |
@set_time_limit(0); | |
@ignore_user_abort(false); | |
@ini_set( 'zlib.output_compression', 'off' ); | |
header('Cache-Control: no-cache'); | |
header('Pragma: no-cache'); | |
header("Content-Type: multipart/x-mixed-replace;boundary=END",true); | |
print "--END\n"; | |
$index = 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
<?php | |
@set_time_limit(0); | |
@ignore_user_abort(false); | |
@ini_set( 'zlib.output_compression', 'off' ); | |
header('Cache-Control: no-cache'); | |
header('Pragma: no-cache'); | |
header("Content-Type: multipart/x-mixed-replace;boundary=END",true); | |
print "--END\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
<?php | |
// Load | |
$lines = file('st.txt'); | |
$BASE = array(); | |
for ($i = 0; $i < count($lines); $i++) { | |
$word = trim($line); | |
$BASE[$i]['word'] = $word; | |
$BASE[$i]['prefix'] = mb_substr($word, 0, 1); | |
$BASE[$i]['suffix'] = mb_substr($word, strlen($word)-1, 1); | |
$BASE[$i]['isUse'] = false; |
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
private static class Cat extends Sprite { | |
public final PhysicsHandler mPhysicsHandler; | |
public Cat(final float pX, final float pY, | |
final TextureRegion pTextureRegion, | |
final VertexBufferObjectManager pVertexBufferObjectManager) { | |
super(pX, pY, pTextureRegion, pVertexBufferObjectManager); | |
mPhysicsHandler = new PhysicsHandler(this); | |
registerUpdateHandler(mPhysicsHandler); | |
mPhysicsHandler.setVelocity(DEMO_VELOCITY, DEMO_VELOCITY); |
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 com.ivoryworks.android.andenginegarage.sprite; | |
import org.andengine.engine.camera.Camera; | |
import org.andengine.engine.options.EngineOptions; | |
import org.andengine.engine.options.ScreenOrientation; | |
import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; | |
import org.andengine.entity.scene.Scene; | |
import org.andengine.entity.scene.background.Background; | |
import org.andengine.entity.sprite.Sprite; | |
import org.andengine.entity.util.FPSLogger; |
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 com.example.Blank; | |
import org.andengine.engine.camera.Camera; | |
import org.andengine.engine.options.EngineOptions; | |
import org.andengine.engine.options.ScreenOrientation; | |
import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; | |
import org.andengine.entity.scene.Scene; | |
import org.andengine.entity.scene.background.Background; | |
import org.andengine.entity.util.FPSLogger; | |
import org.andengine.ui.activity.SimpleBaseGameActivity; |