Skip to content

Instantly share code, notes, and snippets.

View JesseScott's full-sized avatar
💭
trying to decide what to focus on

Jesse Scott JesseScott

💭
trying to decide what to focus on
View GitHub Profile
@kenechiokolo
kenechiokolo / Code for CoreData Video Walkthrough
Created August 26, 2015 16:13
CoreData to CSV file code walkthrough
// MARK: Export functions
func createExportString() -> String {
var date: NSDate? = NSDate()
var worktime: Double?
var breaktime: Double?
var studyRate: Double?
var studyQuota: Double?
var hoursLeft: Int?
var distractionCount: Int?
@fkrauthan
fkrauthan / TLSSocketFactory.java
Last active January 7, 2023 04:09
Custom SSLSocketFactory Implementation to enable tls 1.1 and tls 1.2 for android 4.1 (16+)
package net.cogindo.ssl;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;
@alphamu
alphamu / CreditCardEditText.java
Last active October 13, 2023 09:53
A simple EditText view for use with Credit Cards. It shows an image of the credit card on the right hand side.
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.AppCompatEditText;
import android.util.AttributeSet;
import android.util.SparseArray;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@collindonnell
collindonnell / DeleteManagedObjectsExtension.swift
Last active December 4, 2020 23:38
NSManagedObjectContext extension methods to delete all managed objects, or all objects of a given type in the context.
//
// Created by Collin Donnell on 7/22/15.
// Copyright (c) 2015 Collin Donnell. All rights reserved.
//
import CoreData
extension NSManagedObjectContext {
convenience init(parentContext parent: NSManagedObjectContext, concurrencyType: NSManagedObjectContextConcurrencyType) {
@JesseScott
JesseScott / Chrome Bash
Created May 19, 2015 06:06
Chrome w/o Web Security
open -a Google\ Chrome --args --disable-web-security
@HeinrichHartmann
HeinrichHartmann / GoogleSheetsExample.py
Last active December 5, 2016 20:34
Convenient Access to Google Spreadsheets
# Copyright (c) 2015 Heinrich Hartmann
# MIT License http://choosealicense.com/licenses/mit/
import gdata.spreadsheet.service
class GoogleDriveConnection(object):
def __init__(self, email, password):
self.client = gdata.spreadsheet.service.SpreadsheetsService()
self.client.ClientLogin(email, password)
@kidpixo
kidpixo / jupyter_shortcuts.md
Last active March 2, 2025 04:15
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Warning This is SEVERELY outdated, the current jupyter version is > 6.X, please refer to your current jupyter notebook installation!

Disclaimer : I just copied those shortcuts from Jupyter Menú > Help > Keyboard Shortcuts, I didn't wrote them myself.

Check your current shortcuts in your Help, shortcuts coule have been modified by extensions or your past self.

Toc

Keyboard shortcuts

package YOUR.PACKAGE.HERE;
/*
* The MIT License (MIT)
*
* Copyright (c) <2015> <ameron32>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@sheva29
sheva29 / oF HTTP request
Last active December 7, 2015 07:40
oF GET/POST request
//GET request
//--------------------------------------------------------------
void ofApp::getRequestToURL(){
//This is what we will be posting to the
string getRequest = "http://localhost:8000/api/recommendations/?ids=";
//we pass the IDs to our string for the GET post
for ( int i = 0; i < suggestedProducts.size(); i++){
@roadsideseb
roadsideseb / docker_commands.sh
Last active July 17, 2017 16:51
A few handy Docker commands
# Delete all stopped containers
docker rm $(docker ps -a -q)
# Remove unused, dangling images
docker rmi $(docker images -q -f dangling=true)
# Remove all but X images with a specific name (old image cleanup),
# in this case, we leave the 2 newest images.
$(docker images | grep my-docker-image | tail -n+3 | awk '{ print $1":"$2; }')