Skip to content

Instantly share code, notes, and snippets.

View benc's full-sized avatar

Ben Cochez benc

View GitHub Profile
@bubba-h57
bubba-h57 / instructions.md
Last active October 23, 2023 12:46
Configuring Jetbrains Gateway and WSL

Step 1: SSH Daemon

In your WSL instance, re-install OpenSSH server as follows.

sudo apt remove --purge openssh-server
sudo apt install openssh-server

Edit /etc/ssh/sshd_config (e.g. sudo vi /etc/ssh/sshd_config) and add the following lines to the bottom of the file. Ensure you replace WSL_ACCOUNT_NAME with your WSL2 account name.

@igouss
igouss / ObservableQuery.java
Created September 22, 2015 22:12
RxJava and Hibernate Scrollable query Raw
package com.naxsoft.database;
import org.hibernate.Query;
import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.StatelessSession;
import rx.Observable;
/**
* Copyright NAXSoft 2015
@mackuba
mackuba / wwdc15.md
Last active August 6, 2022 17:28
New stuff from WWDC 2015

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
@omz
omz / PythonistaFTP.py
Last active May 17, 2023 12:43
PythonistaFTP.py
'''FTP server for Pythonista (iOS)
You can use this to exchange files with a Mac/PC or a file management app on the same device (e.g. Transmit).
If you use a Mac, you can connect from the Finder, using the "Go -> Connect to Server..." menu item.
'''
import os
from socket import gethostname
@btford
btford / chillax.md
Created October 30, 2014 06:59
Why you shouldn't worry so much about migrating with Angular

Several developers asked me about how difficult it will be to migrate Angular 1 to Angular 2. Angular 2 isn't done, so I legitimately have no idea how hard it will be. But there are a few high-level guiding principals in the design of Angular 1 that make adapting to changes like this fairly painless.

Angular 1 was designed so it would have a fairly minimal API surface. Let's look at controllers, since these are the meat of your app. Controllers are just functions that get passed other components as arguments:

MyController ($scope) {
  $scope.list = [];
  
  $scope.addItem = function (name) {
    $scope.list.push({
@leucos
leucos / README.md
Last active December 11, 2015 10:28
Ruby playbook example

Deploying Ruby with Ansible

Define these variables somewhere and let it go :

  • ruby_current: the ruby version you want to deploy (e.g. "1.9.3-p374")
  • ruby_user: Under which account we want ruby to be installed (e.g. "myappuser"; "ruby" in this playbook)

Note : this playbook only works with '-i' in the sudo line since it requires the target user environment to be fully loaded

@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active March 31, 2024 18:45 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@PaulCapestany
PaulCapestany / Useful Alfred Custom Searches
Created June 18, 2012 21:13
Useful Alfred Custom Searches
Calendar Quick Add
http://www.google.com/calendar/event?ctext=+{query}+&action=TEMPLATE&pprop=HowCreated%3AQUICKADD
Crunchbase
http://www.crunchbase.com/search?query={query}
Google Three Month Search
http://www.google.com/search?q={query}&tbs=,qdr:m3
Google Year Search
@sergeimuller
sergeimuller / gist:2916697
Last active August 25, 2023 03:52
CQ5 curl commands
Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
@mojavelinux
mojavelinux / AsciiDoc.java
Created March 3, 2012 00:10
Execute AsciiDoc from Java using the Jython Interpreter
import java.io.*;
import javax.script.*;
import org.python.core.PySystemState;
import org.python.core.PyString;
import org.python.util.PythonInterpreter;
/**
* This class executes the AsciiDoc python scripts (asciidoc.py and a2x.py) from
* Java using the Jython interpreter.
*