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
| <?php | |
| $countries = array | |
| ( | |
| 'AF' => 'Afghanistan', | |
| 'AX' => 'Aland Islands', | |
| 'AL' => 'Albania', | |
| 'DZ' => 'Algeria', | |
| 'AS' => 'American Samoa', | |
| 'AD' => 'Andorra', |
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
| <?php | |
| function toBase($num, $b=62) { | |
| $base='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
| $r = $num % $b ; | |
| $res = $base[$r]; | |
| $q = floor($num/$b); | |
| while ($q) { | |
| $r = $q % $b; | |
| $q =floor($q/$b); | |
| $res = $base[$r].$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
| defaults delete com.apple.dt.Xcode | |
| rm -rf $HOME/Library/Application Support/Developer/Shared/Xcode | |
| rm -rf $HOME/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState | |
| rm -rf $HOME/Library/Preferences/com.apple.dt.Xcode.* |
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
| package me.amcapp.amc.Tasks; | |
| import android.content.Context; | |
| import com.android.volley.Request; | |
| import com.android.volley.RequestQueue; | |
| import com.android.volley.toolbox.Volley; | |
| /** | |
| * Created by CHEA THAILY on 11/8/2017. |
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
| <?php | |
| function get_client_ip_server() { | |
| $ipaddress = ''; | |
| if (isset($_SERVER['HTTP_CLIENT_IP'])) | |
| $ipaddress = $_SERVER['HTTP_CLIENT_IP']; | |
| else if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) | |
| $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
| else if(isset($_SERVER['HTTP_X_FORWARDED'])) | |
| $ipaddress = $_SERVER['HTTP_X_FORWARDED']; | |
| else if(isset($_SERVER['HTTP_FORWARDED_FOR'])) |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace DelegateSample | |
| { | |
| class Program | |
| { |
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
| import grequests | |
| urls = [ | |
| 'https://graph.facebook.com/', | |
| 'https://graph.facebook.com/2', | |
| ] | |
| rs = (grequests.get(u) for u in urls) | |
| p = grequests.map(rs) |
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
| import requests | |
| r = requests.get('https://github.com/timeline.json') | |
| print(r.json()['message']) |
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 file_get_contents(filename): | |
| with open(filename) as f: | |
| content = f.read() | |
| f.close() | |
| return content |
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
| using System.Collections.Generic; | |
| using System.Collections.Specialized; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Web; | |
| public static class Extensions | |
| { | |
| public static string ToPostData(this NameValueCollection @this) |