Skip to content

Instantly share code, notes, and snippets.

View jordansjones's full-sized avatar
💭
Lame

Jordan S. Jones jordansjones

💭
Lame
View GitHub Profile
@jordansjones
jordansjones / reclaimWindows10.ps1
Created January 8, 2017 07:04 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
@jordansjones
jordansjones / gist:6170262
Created August 7, 2013 00:42
Linq to Rest API
// Service Client doesn't make the call until we attempt to enumerate the results (.ToList())
var serviceClient = new UsersServiceClient();
List<User> disabledUsers = serviceClient.Get().Where(user => user.IsDisabled).ToList();
// Or a more complex example
var serviceClient = new IssuesServiceClient();
var query = serviceClient.Get()
// At this point the query hasn't run
@jordansjones
jordansjones / gist:5799913
Created June 17, 2013 20:11
Example Service Client interface
[ServiceClient("/path/to/endpoint", BaseType = typeof(BaseServiceClient<HelloWorldDto, int>))]
public interface IHelloWorldClient {
[HttpGet]
IObservable<HelloWorldDto> GetBy(int key);
[HttpPost]
IObservable<HelloWorldDto> Create(HelloWorldDto entity);
}
@jordansjones
jordansjones / gist:5762876
Created June 12, 2013 04:39
Using reflection to call AsyncSubject methods
private object InterceptGet(string url, IInvocation invocation)
{
var retVal = invocation.Method.ReturnType;
if (retVal.IsGenericType && retVal.Name == typeof (IObservable<>).Name)
{
retVal = retVal.GenericTypeArguments[0];
}
var retType = _subjectType.MakeGenericType(retVal);
@jordansjones
jordansjones / DoThis.java
Created December 11, 2012 20:07
This is a stupid idea...
@Post("/account/{accountId}/changeEmail")
public class ChangeEmailRequest {
private int accountId;
private String newEmailAddress;
}
// Then the Handler
@jordansjones
jordansjones / BaseMixin.js
Created October 25, 2012 22:03
Mixin stuff
{
extend: function (target) {
var clone = _.clone(this);
_.extend(clone, target);
return clone;
},
beforeMixin: function (target) {},
afterMixin: function (target) {},
@jordansjones
jordansjones / gist:3830675
Created October 4, 2012 00:03
My day (October 3, 2012)
@mixin reset-stupid-background($selectors) {
@each $sel in $selectors {
#{$sel} {
background: none !important;
}
}
}
@include reset-stupid-background(
"ul.x-tab-strip-top"
public class App {
public static void main(String[] args) throws SQLException {
final String username = "jordan";
final String password = "test";
final String db = "test";
final String query = "SELECT SUM(UpVotes), COUNT(Id) FROM users";
DriverManager.registerDriver(new Driver());
try (final Connection connection = DriverManager.getConnection("jdbc:mysql://192.168.100.150/test", username, password)) {