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
public string ImageToBase64(Image image, | |
System.Drawing.Imaging.ImageFormat format) | |
{ | |
using (MemoryStream ms = new MemoryStream()) | |
{ | |
// Convert Image to byte[] | |
image.Save(ms, format); | |
byte[] imageBytes = ms.ToArray(); | |
// Convert byte[] to Base64 String |
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 java.awt.BasicStroke; | |
import java.awt.Color; | |
import java.awt.Dimension; | |
import java.awt.FontMetrics; | |
import java.awt.Graphics; | |
import java.awt.Graphics2D; | |
import java.awt.Point; | |
import java.awt.RenderingHints; | |
import java.awt.Stroke; | |
import java.util.ArrayList; |
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.company; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
/** | |
* Logic 1 | |
* |
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 anim; | |
import java.awt.Dimension; | |
import java.awt.Graphics; | |
import java.awt.Image; | |
import java.io.IOException; | |
import java.net.URL; | |
import javax.imageio.ImageIO; | |
import javax.swing.JFrame; |
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 requests | |
import json | |
url = 'https://api.github.com/some/endpoint' | |
payload = {'some': 'data'} | |
# Create your header as required | |
headers = {"content-type": "application/json", "Authorization": "<auth-key>" } | |
r = requests.put(url, data=json.dumps(payload), headers=headers) |
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
#!/usr/bin/env python3.4 | |
#### Nyaundi Brian <ndieksman@gmail.com> | |
from pprint import pprint | |
links_string_from_header='<https://api.github.com/search/users?q=location%3AKenya&page=4>; rel="next",' \ | |
' <https://api.github.com/search/users?q=location%3AKenya&page=34>; rel="last", ' \ | |
'<https://api.github.com/search/users?q=location%3AKenya&page=1>; rel="first", ' \ | |
'<https://api.github.com/search/users?q=location%3AKenya&page=2>; rel="prev"' |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
// A simple PHP script demonstrating how to connect to MySQL. | |
// Press the 'Run' button on the top to start the web server, | |
// then click the URL that is emitted to the Output tab of the console. | |
$servername = getenv('IP'); | |
$username = getenv('C9_USER'); | |
$password = ""; | |
$database = "c9"; | |
$dbport = 3306; |
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
# Show current git branch in prompt. | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
L="\[\033[0;35m\]" |
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
[ | |
[ | |
"_m.a.i.c.a_", | |
1 | |
], | |
[ | |
"__elibarikidaniel_marando__", | |
1 | |
], | |
[ |