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 selectSnippetInList(snippet: Snippet) { | |
this.appEventsService.push({ | |
type: AppEventType.SelectSnippet, | |
data: { snippet } | |
}); | |
} |
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 HelloWorld { | |
public static void main(String[] args) { | |
// Prints "Hello, World" to the terminal window. | |
System.out.println("Hello, World"); | |
} | |
} |
From Electron's main.ts
:
import { BrowserWindow, ipcMain } from 'electron';
...
ipcMain.on(
'close-paypal',
() => {
BrowserWindow.getAllWindows().forEach((win) => {
// The Paypal window would fail to load contents due to security
// restrictions and return an empty URL
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
// PhantomJS Cheatsheet | |
$ brew update && brew install phantomjs // install PhantomJS with brew | |
phantom.exit(); | |
var page = require('webpage').create(); | |
page.open('http://example.com', function() {}); | |
page.evaluate(function() { return document.title; }); |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
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
Time.now.advance(:days => 1, :hours => -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
[true, false].sample |
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
jQuery( | |
function($) | |
{ | |
$('#flux').bind('scroll', function() | |
{ | |
if($(this).scrollTop() + | |
$(this).innerHeight() | |
>= $(this)[0].scrollHeight) | |
{ | |
alert('end reached'); |
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
initdb /usr/local/var/postgres -E utf8 # create a database cluster | |
postgres -D /usr/local/var/postgres # serve that database | |
PGDATA=/usr/local/var/postgres postgres # …alternatively | |
If builds of PostgreSQL 9 are failing and you have version 8.x installed, | |
you may need to remove the previous version first. See: | |
https://github.com/mxcl/homebrew/issues/issue/2510 | |
To migrate existing data from a previous major version (pre-9.3) of PostgreSQL, see: | |
http://www.postgresql.org/docs/9.3/static/upgrading.html |
NewerOlder