Skip to content

Instantly share code, notes, and snippets.

View codemonkey85's full-sized avatar

Michael Bond codemonkey85

View GitHub Profile
@JackDanger
JackDanger / git-remove-history.sh
Created August 19, 2010 22:06
remove large binary files from git history
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
#
# retrieved from: http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/
#
@gauteh
gauteh / crypttest.cs
Last active October 7, 2019 09:30
Demonstrates how to serialize and encrypt any object in C#
/*
* crypttest.cs: Demonstrates how to serialize and encrypt any object
*
* Gaute Hope <eg@gaute.vetsj.com>
*
* To deserialize it you need to know the unencrypted serialized length.
* So to store or send also pass the length, e.g. create a struct like this:
*
* public struct EncryptedObject {
* public int length;
@omz
omz / New from Gist.py
Created November 15, 2012 04:52
New from Gist
### Based on: https://gist.github.com/b0644f5ed1d94bd32805
### This version strips unicode characters from the downloaded script
### to work around the currently limited unicode support of the editor
### module.
# This script downloads and opens a Gist from a URL in the clipboard.
# It's meant to be put in the editor's actions menu.
#
# It works with "raw" and "web" gist URLs, but not with gists that
# contain multiple files or non-Python files.
@lukewpatterson
lukewpatterson / gist:4242707
Created December 9, 2012 00:24
squeezing private SSH key into .travis.yml file
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
search = [ notebook , separator ] ,
[ "any:" , separator ] ,
term ,
{ separator , term } ;
notebook = "notebook:" , ( word | quoted ) ;
word = wordchar , { wordchar } ;
quoted = '"' , { ( any - '"' ) | '\"' } , '"' ;
This file has been truncated, but you can view the full file.
[
{
"id": "001",
"name": "Bulbasaur",
"img": "http://img.pokemondb.net/artwork/bulbasaur.jpg",
"type": [
"Grass",
"Poison"
],
"stats": {
@jogleasonjr
jogleasonjr / SlackClient.cs
Last active October 20, 2023 15:54
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{
@smealum
smealum / bch2obj.py
Created March 6, 2014 16:51
pokemon X/Y simple model/texture parser
import struct
import math
import os
import sys
if sys.version > '3':
buffer = memoryview
def getWord(b, k, n=4):
return sum(list(map(lambda c: b[k+c]<<(c*8),range(n))))
@eevee
eevee / deferred_attr.py
Created March 20, 2014 18:28
sqlalchemy declarative deferred attributes
class DeferredAttribute(object):
"""Minor hackery used with `deferred_attr_factory`."""
# Hopefully, more or less, self-explanatory. The __call__ is triggered at
# class creation time by declared_attr, which passes in the class itself,
# and then we do the "post" setup by listening for mapper_configured.
def __init__(self, generator):
self.generator = generator
self.done = False
def __call__(self, mapped_class):
@archon810
archon810 / BuildConfig.java
Last active September 28, 2022 15:17
Fake Virus Shield AV
package com.deviant.security.shield;
public final class BuildConfig {
public static final String BUILD_TYPE = "debug";
public static final boolean DEBUG;
public static final String FLAVOR = "";
public static final String PACKAGE_NAME = "com.deviant.security.shield";
public static final int VERSION_CODE = 4;
public static final String VERSION_NAME = "2.2";