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
static const string regex_string = """((https?|file|ftps?|irc|sftp|ldaps?|nfs|smb|rsync | |
|ssh|rlogin|telnet|git|git\+ssh|bzr|bzr\+ssh|svn | |
|svn\+ssh|hg|mailto|magnet):\/?)?(\~|\/\/?[!-~][^\"]+)+\/?"""; |
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 class CyClientService extends Service { | |
public static final String USERNAME = ""; | |
public static final String PASSWORD = ""; | |
public static final String SERVER = ""; | |
private Boolean cont = true; | |
private CyberLoginManager loginManager; | |
@Override | |
public int onStartCommand(Intent intent, int flags, int startId) { |
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 void initLogin () { | |
Result res = loginMan.Login(); | |
if (res.success) { | |
status = "LIVE"; | |
mHandler.postDelayed(liveLoginTask, 1800L); | |
} | |
else { | |
//TODO send error to activity | |
mUsernameTxt.setText("Login"); | |
} |
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
/* compile using: valac --pkg gtk+-3.0 wall.vala */ | |
using Gtk; | |
using Gdk; | |
using Cairo; | |
public class AppWin : Gtk.Window { | |
construct { | |
app_paintable = true; | |
decorated = false; | |
resizable = 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
// valac --pkg gtk+-3.0 show-uri.vala | |
void main (string[] args) { | |
Gtk.show_uri (Gdk.Screen.get_default(), "http://www.google.com",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
// valac --pkg gtk+-3.0 indicator-test.vala | |
using Gtk; | |
void main (string[] args) { | |
Gtk.init (ref args); | |
var status_icon = new Gtk.StatusIcon.from_stock (Gtk.Stock.MEDIA_PLAY); | |
status_icon.set_tooltip_text ("Adjust Sound"); | |
status_icon.activate.connect (() => { | |
print ("clicked"); |
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
namespace PApp { | |
void main () { | |
print ("Hello\n"); | |
for (;;) { | |
string? r = stdin.read_line (); | |
if (r != null && r != "quit") { | |
//do_something (r); | |
Plugins.run_cmd (r); | |
} else { |
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
void main () { | |
var file = "/home/<user>/Downloads/woah_dude.gif"; | |
var mime = "image/gif"; | |
var contractor = new Granite.Services.Contractor.for_mime (mime); | |
foreach (var contract in contractor.get_contracts ()) { | |
print ("id: "+contract.id+" name:" +contract.display_name); | |
} | |
var option = readline ("Enter id"); | |
contractor.execute (id, file); |
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
namespace MangaFoxParser { | |
//Delegate for afte comic data is received | |
public delegate void ComicDataCB (List<Comic?> comic); | |
public class ComicDataTask { | |
public unowned ComicDataManager manager; | |
public ComicDataCB callback; | |
public ComicDataTask (ComicDataManager manager) { | |
this.manager = manager; |
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
old_width=$(gsettings get org.pantheon.terminal.saved-state window-width) | |
old_height=$(gsettings get org.pantheon.terminal.saved-state window-height) | |
new_width=150 | |
new_height=150 | |
gsettings set org.pantheon.terminal.saved-state window-width $new_width | |
gsettings set org.pantheon.terminal.saved-state window-height $new_height | |
pantheon-terminal > /dev/null & |
OlderNewer